Skip to content

Instantly share code, notes, and snippets.

@netsatsawat
Created October 13, 2019 19:08
Show Gist options
  • Save netsatsawat/47666fe7fb86c340c937084cad1c16e0 to your computer and use it in GitHub Desktop.
Save netsatsawat/47666fe7fb86c340c937084cad1c16e0 to your computer and use it in GitHub Desktop.
Generate data blob for clustering tutorial
from sklearn.datasets import make_blobs
import numpy as np
SEED = 123
N_SAMPLES = 10000
N_FEATURES = 2
N_CENTERS = 5
np.random.seed(SEED)
X, y = make_blobs(n_samples=N_SAMPLES, n_features=N_FEATURES, centers=N_CENTERS,
cluster_std=1.3, shuffle=True, random_state=SEED)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment