Advertisement
Guest User

Untitled

a guest
Oct 13th, 2019
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
  2.  
  3. lda = LinearDiscriminantAnalysis(n_components=1)
  4.  
  5. # run an LDA and use it to transform the features
  6. X_lda = lda.fit(X, Y).transform(X)
  7. print('Original number of features:', X.shape[1])
  8. print('Reduced number of features:', X_lda.shape[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement