Skip to content

Instantly share code, notes, and snippets.

@wibowotangara
Created January 24, 2024 06:29
Show Gist options
  • Save wibowotangara/c52e1d3b9e7bcec5898832f1bb038d1d to your computer and use it in GitHub Desktop.
Save wibowotangara/c52e1d3b9e7bcec5898832f1bb038d1d to your computer and use it in GitHub Desktop.
df_top_features = df_all_features.head(10).sort_values(by='importance', ascending=True)
plt.figure(figsize=(10, 6))
plt.barh(df_top_features['feature'], df_top_features['importance'], color='skyblue')
plt.xlabel('Importance')
plt.title('Top 10 Feature Importances')
for index, value in enumerate(df_top_features['importance']):
plt.text(value, index, f'{value:.4f}', va='center')
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment