Created
May 14, 2018 07:27
-
-
Save andreaschandra/f7140f27a7dfd0a34b9d6b232618292b to your computer and use it in GitHub Desktop.
Clustering model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
minibatch = False | |
true_k = 4 | |
if minibatch: | |
km = MiniBatchKMeans(n_clusters = true_k, init='k-means++', n_init=1, | |
init_size=1000, batch_size=1000, verbose = False) | |
else: | |
km = KMeans(n_clusters=true_k, init='k-means++', max_iter=100, n_init=1, | |
verbose = False) | |
print("Clustering sparse data with %s" % km) | |
t0 = time() | |
km.fit(X) | |
print("done in %0.3fs" % (time() - t0)) | |
print() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment