📜  sklearn 中的 PCA - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:47.136000             🧑  作者: Mango

代码示例2
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_)