Skip to content

Instantly share code, notes, and snippets.

@KhyatiMahendru
Created July 16, 2019 06:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KhyatiMahendru/257cd0a881b88210849c916299621854 to your computer and use it in GitHub Desktop.
Save KhyatiMahendru/257cd0a881b88210849c916299621854 to your computer and use it in GitHub Desktop.
from sklearn.decomposition import PCA
// say you want to reduce to 2 features
pca = PCA(n_components = 2)
// obtain transformed data
data_transformed = pca.fit_transform(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment