Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

apply pca to dataframe

import pandas as pd
import numpy as np
from sklearn.decomposition import PCA

df = pd.DataFrame(data=np.random.normal(0, 1, (20, 10)))

pca = PCA(n_components=5)
pca.fit(df)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #apply #pca #dataframe
ADD COMMENT
Topic
Name
5+3 =