Created
August 22, 2019 12:45
-
-
Save xoraus/54d5f7eaf012d0fc15caffe63cfe5782 to your computer and use it in GitHub Desktop.
This file contains 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
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