Created
June 1, 2019 18:16
-
-
Save jetnew/b5b45540cb2d0920539d7ab5b179e379 to your computer and use it in GitHub Desktop.
K-Means using scikit-learn
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 KMeans | |
clusters = 3 | |
y_pred = KMeans(n_clusters=clusters).fit_predict(X) | |
plt.scatter(X[:,0], X[:,1], c=y_pred) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment