In R there are pre-built functions to plot feature importance of Random Forest model. But in python such method seems to be missing. I search for a method in matplotlib
matplotlib
It's possible to just pass df.columns as the parameter for plt.xticks(),i have written a sample implementation.
df.columns
plt.xticks()
plt.bar( range(len(model.feature_importances_)), model.feature_importances_) plt.xticks(range(len(model.feature_importances_)), train_features.columns) plt.show()