Skip to content

Instantly share code, notes, and snippets.

@KhyatiMahendru
Created July 16, 2019 12:16
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/e2373209e01d50a8096753deabd38fbb to your computer and use it in GitHub Desktop.
Save KhyatiMahendru/e2373209e01d50a8096753deabd38fbb to your computer and use it in GitHub Desktop.
from sklearn.decomposition import TruncatedSVD
// say you want to reduce to 2 features
svd = TruncatedSVD(n_features = 2)
//obtain the transformed data
data_transformed = svd.fit_transform(data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment