jeudi 23 septembre 2021

how to display top 10 feature importance for random forest

was just wondering if it's possible to only display top 10 feature_importance for random forest? here's my code.

model1 = RandomForestClassifier() model1.fit(X_train, y_train) pd.Series(model1.feature_importances_, index=X_train.columns)

i tried the above and the result i get is the full list of all 70+ features, and not in any order. :(

MonthlyMinutes 0.048203

TotalRecurringCharge 0.028393

MonthlyRevenue 0.041576

DirectorAssistedCalls 0.019973

Thank you.




Aucun commentaire:

Enregistrer un commentaire