Skip to content

Instantly share code, notes, and snippets.

@dradecic
Created September 1, 2019 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dradecic/4bc8f929a86795c0d9c5e663293cd71f to your computer and use it in GitHub Desktop.
Save dradecic/4bc8f929a86795c0d9c5e663293cd71f to your computer and use it in GitHub Desktop.
rfecv_7_imporance_plotting
dset = pd.DataFrame()
dset['attr'] = X.columns
dset['importance'] = rfecv.estimator_.feature_importances_
dset = dset.sort_values(by='importance', ascending=False)
plt.figure(figsize=(16, 14))
plt.barh(y=dset['attr'], width=dset['importance'], color='#1976D2')
plt.title('RFECV - Feature Importances', fontsize=20, fontweight='bold', pad=20)
plt.xlabel('Importance', fontsize=14, labelpad=20)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment