Created
November 22, 2021 23:57
-
-
Save andrea-dagostino/df1d751b85295a0783473233851f84d8 to your computer and use it in GitHub Desktop.
posts/raggruppamento-testuale-con-tf-idf
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 | |
# inizializziamo il kmeans con 3 centroidi | |
kmeans = KMeans(n_clusters=3, random_state=42) | |
# addestriamo il modello | |
kmeans.fit(X) | |
# salviamo i gruppi di ogni punto | |
clusters = kmeans.labels_ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment