Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
- lda = LinearDiscriminantAnalysis(n_components=1)
- # run an LDA and use it to transform the features
- X_lda = lda.fit(X, Y).transform(X)
- print('Original number of features:', X.shape[1])
- print('Reduced number of features:', X_lda.shape[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement