Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn import decomposition, datasets
- k = 3
- iris = datasets.load_iris()
- X = iris.data
- Y = iris.target
- pca = decomposition.PCA(n_components=k)
- pca.fit(X)
- Z = pca.transform(X)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement