Created
November 23, 2021 11:53
-
-
Save andrea-dagostino/3a2761d90f5a4b3397224c848a181265 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.decomposition import PCA | |
# inizializziamo la PCA con 2 componenti | |
pca = PCA(n_components=2, random_state=42) | |
# passiamo alla pca il nostro array X | |
pca_vecs = pca.fit_transform(X.toarray()) | |
# salviamo le nostre due dimensioni in x0 e x1 | |
x0 = pca_vecs[:, 0] | |
x1 = pca_vecs[:, 1] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment