Skip to content

Instantly share code, notes, and snippets.

@khyatimahendru
Created July 16, 2019 06:58
Show Gist options
  • Select an option

  • Save khyatimahendru/257cd0a881b88210849c916299621854 to your computer and use it in GitHub Desktop.

Select an option

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