Skip to content

Instantly share code, notes, and snippets.

@rkdgusrn1212
Last active June 8, 2022 04:14
PCA(Principal Component Analysis)
from sklearn.decomposition import PCA
X = (X - X.mean(axis=0)) / X.std(axis=0)
pca = PCA()
X_pca = pca.fit_transform(X)
#X_pca는 2차원 ndarray다.row=index,column=principle component
#pca.component_로 row=principle component col=feature인 2차원 배열을 얻을 수 있다.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment