Skip to content

Instantly share code, notes, and snippets.

@kushalvyas
Created July 19, 2016 17:17
Show Gist options
  • Save kushalvyas/590b7e1adad10656793cfb78f041193a to your computer and use it in GitHub Desktop.
Save kushalvyas/590b7e1adad10656793cfb78f041193a to your computer and use it in GitHub Desktop.
n_samples = 1000
n_features = 5;
n_clusters = 3;
# aint this sweet
X, y = make_blobs(n_samples, n_features)
# X => array of shape [nsamples,nfeatures] ;;; y => array of shape[nsamples]
# X : generated samples, y : integer labels for cluster membership of each sample
# performing KMeans clustering
ret = KMeans(n_clusters = n_clusters).fit_predict(X)
@daffaabiyyu05
Copy link

make_blobs is part of sklearn I presume?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment