Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pca python

from sklearn.decomposition import PCA

pca = PCA(n_components=3)
pca.fit(features)
features_pca = pca.transform(features)
print("original shape:   ", features.shape)
print("transformed shape:", features_pca.shape)
print(pca.explained_variance_)
print(pca.explained_variance_ratio_)
 
PREVIOUS NEXT
Tagged: #pca #python
ADD COMMENT
Topic
Name
1+4 =