Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Datasets and toy loaders

solow-datasets covers synthetic classification and regression generators, geometry benchmarks (moons, circles, Swiss roll), classic loaders (iris, wine, diabetes, breast cancer), and utility helpers for class weights and resampling.

Toy loaders

FunctionWhat it does
load_iris150-sample 4-feature Iris flower classification.
load_wine178-sample 13-feature wine cultivar classification.
load_diabetes442-sample 10-feature diabetes regression.
load_breast_cancer569-sample 30-feature Wisconsin breast cancer classification.

Synthetic generators

FunctionWhat it does
make_classificationMulti-class informative + redundant + noise features with configurable class separation.
make_regressionLinear regression targets with configurable noise and coefficient sparsity.
make_blobsIsotropic Gaussian blobs in R^n.
make_moonsTwo interleaving half-circles for non-linear boundary testing.
make_circlesConcentric circles for non-linear kernel benchmarks.
make_swiss_rollClassic manifold-learning benchmark.
make_low_rank_matrixLow-rank matrix with controllable singular value profile for factorization tests.

Utility helpers

FunctionWhat it does
compute_class_weightBalanced class weights from a label array.
compute_sample_weightPer-sample weights matching a balanced class weighting.
resample_indices_with_replace, resample_indices_no_replaceDeterministic resampling with a caller seed.

Example

#![allow(unused)]
fn main() {
use solow_datasets::{load_iris, make_classification};

let iris = load_iris();
let (x, y) = make_classification(500, 20, 3, 42);
}

Every generator uses a portable MMIX-LCG PRNG. A fixed seed reproduces the dataset bit-for-bit across runs and platforms.