Advertisement
akashtadwai

rf-feature_importance_plot

Jul 15th, 2021
1,114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. def feature_plot(imp):
  2.     fimp = pd.DataFrame({'Feature': X.columns, 'Importance' : np.round(imp,5)})
  3.     fimp =fimp.sort_values(by='Importance', ascending=False)
  4.     plt.figure(figsize=(30,15))
  5.     plt.plot(fimp['Feature'], fimp['Importance'])
  6.     plt.xticks(rotation=90);
  7.  
  8. feature_plot(rf.feature_importances_*100)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement