sklearn.datasets.make_blobs — scikit-learn 0.20.4 documentation (original) (raw)
Generate isotropic Gaussian blobs for clustering.
from sklearn.datasets.samples_generator import make_blobs X, y = make_blobs(n_samples=10, centers=3, n_features=2, ... random_state=0) print(X.shape) (10, 2) y array([0, 0, 1, 0, 2, 2, 2, 1, 1, 0]) X, y = make_blobs(n_samples=[3, 3, 4], centers=None, n_features=2, ... random_state=0) print(X.shape) (10, 2) y array([0, 1, 2, 0, 2, 2, 2, 1, 1, 0])