Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pca python

import numpy as np
from sklearn.decomposition import PCA

pca = PCA(n_components = 3) # Choose number of components
pca.fit(X) # fit on X_train if train/test split applied

print(pca.explained_variance_ratio_)
 
PREVIOUS NEXT
Tagged: #pca #python
ADD COMMENT
Topic
Name
7+2 =