feature_importances(X, model, n_feats=5)¶
Print a list of important features. Also returns a list of column names.
- X (pd.DataFrame) – The dataframe from which the features are drawn.
- model (sklearn.ensemble) – A model with a
- n_feats (int) – Number of feature importances to return.
A list of n_feats feature column names.
>>> from henchman.learning import feature_importances >>> my_feats = feature_importances(X, fit_model, n_feats=5) >>> X[my_feats].head()