Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // K-Means
- // It is only really suitable when you have a good estimate of the number clusters that exist in your unlabeled data
- from sklearn.cluster import KMeans
- kmeans = KMeans(n_clusters=5)
- kmeans.fit(df)
- labels = kmeans.predict(df)
- centroids = kmeans.cluster_centers_
Add Comment
Please, Sign In to add comment