Answers for "pca"

6

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_)
Posted by: Guest on November-08-2020
1

pccoe

PCCOE
Posted by: Guest on March-03-2021
3

pca

#if required,do pca 1st 
#then outliers removal then skewness removal

from sklearn.decomposition import PCA
pca=PCA(n_components=20)
pca.fit(df)
x_pca=pca.transform(df)
print(x_pca.shape)
x_pca20=pd.DataFrame(data=x_pca)
x_pca20
Posted by: Guest on August-11-2020

Python Answers by Framework

Browse Popular Code Answers by Language