Skip to main content

Module datasets

Module datasets 

Source
Expand description

Deterministic synthetic datasets for demonstrating and testing the learning algorithms.

Every generator takes a seed, so results are reproducible. Feature matrices have one sample per row.

See the book entry Foundations.

Functions§

make_blobs
Gaussian blobs: per_cluster points around each centre with standard deviation spread. Returns the points and the true cluster of each.
make_circles
Two concentric circles: the inner has radius factor times the outer’s (radius 1).
make_classification
Three Gaussian classes in four dimensions with deliberately overlapping, correlated features, a small stand-in for a tabular classification benchmark.
make_moons
Two interleaving half circles (“moons”): n points per moon with Gaussian noise.
make_regression
A linear regression problem y = Xw + b + noise with standard-normal features. Returns (x, y, true weights, true intercept).
make_sine
A noisy sine curve y = sin(x) sampled at samples random points in [0, 2π], as a one-column feature matrix; a classic nonlinear regression demonstration.
make_swiss_roll
The “Swiss roll”: a 2D sheet rolled up in 3D, a standard test for manifold learning. Returns the 3D points and each point’s position along the roll.