RandomRBF generator: Gaussian clouds around random centroids.

Places weighted centroids at random positions in feature space, one group per class, then samples points from a Gaussian around a randomly chosen centroid. Class regions overlap and are not linearly separable, and both the number of classes and the number of centroids are free parameters.

Classes

RandomRBF

class datasets.generators.classification.random_rbf.RandomRBF(ClassificationGenerator)

RandomRBF synthetic data generator for classification.

Generates data by first creating a random set of centers (centroids) for each class. Each center is assigned a weight, a central position in the feature space, and a standard deviation. Instances are generated by selecting a center based on its weight and sampling from a Gaussian distribution around it.
Constructor
__init__(
    self,
    n_samples: int = 100,
    n_features: int = 10,
    n_classes: int = 2,
    n_centroids: int = 50,
    random_state: Optional[int] = None,
)

Parameters

n_samples
int = 100
Number of data points to generate.
n_features
int = 10
Number of attributes (features) for each instance.
n_classes
int = 2
Number of distinct classes in the generated data.
n_centroids
int = 50
Total number of RBF centers (centroids) to distribute among classes.
random_state
int or None = None
Random seed for reproducibility.
python
>>> from tuiml.datasets.generators.classification import RandomRBF
>>> gen = RandomRBF(n_samples=1000, n_features=10, n_classes=3)
>>> data = gen.generate()
>>> print(data.X.shape)
(1000, 10)

Methods

generate (self) -> GeneratedData

Generate RandomRBF data.

Returns
GeneratedData
Generated dataset with feature array X of shape (n_samples, n_features) and class labels y.
get_parameter_schema (cls) -> Dict[str, Any]

Return JSON Schema for constructor parameters.