jasmine.datasets.generate_classification
- jasmine.datasets.generate_classification(n_samples: int = 100, n_features: int = 20, n_informative: int = 5, n_redundant: int = 2, n_classes: int = 2, class_sep: float = 1.0, feature_noise: float = 1.0, redundant_noise: float = 0.0, shuffle: bool = True, random_state: int | None = None) Tuple[Array, Array][source]
Generate a random n-class classification problem with.
This function creates clusters of points normally distributed around vertices of a hypercube, making it suitable for testing classification algorithms.
- Parameters:
n_samples – The number of samples.
n_features – The total number of features.
n_informative – The number of informative features.
n_redundant – The number of redundant features (linear combinations of informative features).
n_classes – The number of classes (or labels).
class_sep – Factor multiplying the hypercube size. Larger values spread out the classes and make the problem easier.
shuffle – Whether to shuffle the features.
random_state – Seed for the random number generator.
- Returns:
A tuple (X, y) where X is the feature matrix and y are the integer labels.