make_moons
- sklearn.datasets.make_moons(n_samples=100, *, shuffle=True, noise=None, random_state=None)
Make two interleaving half circles.
A simple toy dataset to visualize clustering and classification algorithms. Read more in the User Guide.
Make two interleaving half circles.
A simple toy dataset to visualize clustering and classification algorithms. Read more in the User Guide.
If int, the total number of points generated. If two-element tuple, number of points in each of two moons.
Whether to shuffle the samples.
Standard deviation of Gaussian noise added to the data.
Determines random number generation for dataset shuffling and noise. Pass an int for reproducible output across multiple function calls. See Glossary.
The generated samples.
The integer labels (0 or 1) for class membership of each sample.
>>> from sklearn.datasets import make_moons
>>> X, y = make_moons(n_samples=200, noise=0.2, random_state=42)
>>> X.shape
(200, 2)
>>> y.shape
(200,)
Comparing different clustering algorithms on toy datasets
Comparing different hierarchical linkage methods on toy datasets
Comparing anomaly detection algorithms for outlier detection on toy datasets
Statistical comparison of models using grid search
Compare Stochastic learning strategies for MLPClassifier