Skip to content

Instantly share code, notes, and snippets.

@sazio
Created August 17, 2020 22:25
Show Gist options
  • Save sazio/ce5bca68324e4d20fff414391da39ba2 to your computer and use it in GitHub Desktop.
Save sazio/ce5bca68324e4d20fff414391da39ba2 to your computer and use it in GitHub Desktop.
from sklearn.feature_selection import SelectFromModel
# configure to select a subset of features
fs = SelectFromModel(RandomForestClassifier(n_estimators=200), max_features=5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment