Skip to main content

make_sparse_classification

Function make_sparse_classification 

Source
pub fn make_sparse_classification(
    config: &SparseClassConfig,
) -> SparseClassDataset
Expand description

Generate a high-dimensional sparse classification dataset.

Only n_informative out of n_features dimensions carry signal. Each class gets a centroid drawn from N(0,1) projected only onto the informative features. Samples are drawn by adding small Gaussian noise to their class centroid; non-informative features remain exactly 0.

§Arguments

  • config - Generator configuration

§Returns

A SparseClassDataset where x has shape (n_samples × n_features).