Skip to content

Instantly share code, notes, and snippets.

@xoraus
Created August 22, 2019 12:45
Show Gist options
  • Save xoraus/54d5f7eaf012d0fc15caffe63cfe5782 to your computer and use it in GitHub Desktop.
Save xoraus/54d5f7eaf012d0fc15caffe63cfe5782 to your computer and use it in GitHub Desktop.
from sklearn.cluster import MiniBatchKMeans
n_digits = len(np.unique(y_test))
print(n_digits)
# Initialize KMeans model
kmeans = MiniBatchKMeans(n_clusters = n_digits)
# Fit the model to the training data
kmeans.fit(X)
kmeans.labels_
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment