Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from sklearn.feature_selection import RFE
- from sklearn.linear_model import LogisticRegression
- #Recursive feature elimination method, returning the data after feature selection
- #Parameter estimator is the base model
- #Parameter n_features_to_select is the number of features selected
- RFE(estimator=LogisticRegression(),n_features_to_select=2).fit_transform(iris.data, iris.target)
Add Comment
Please, Sign In to add comment