generate_spirals

proglearn.sims.generate_spirals(n_samples, n_class=2, noise=0.3, random_state=None)[source]

Generate 2-dimensional Gaussian XOR distribution. (Classic XOR problem but each point is the center of a Gaussian blob distribution)

Parameters

n_samples : int

Total number of points divided among the four clusters with equal probability.

n_class : array of shape [n_centers], optional (default=2)

Number of class for the spiral simulation.

noise : float, optional (default=0.3)

Parameter controlling the spread of each class.

random_state : int, RandomState instance, default=None

Determines random number generation for dataset creation. Pass an int for reproducible output across multiple function calls.

Returns

X : array of shape [n_samples, 2]

The generated samples.

y : array of shape [n_samples]

The integer labels for cluster membership of each sample.