Guest User

Untitled

a guest
Dec 14th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. // K-Means
  2.  
  3. // It is only really suitable when you have a good estimate of the number clusters that exist in your unlabeled data
  4. from sklearn.cluster import KMeans
  5. kmeans = KMeans(n_clusters=5)
  6. kmeans.fit(df)
  7. labels = kmeans.predict(df)
  8. centroids = kmeans.cluster_centers_
Add Comment
Please, Sign In to add comment