Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

How to plot Feature importance of any model in python

#Feature importance from any model can be plotted as follows:

importances = model.feature_importances_ 
idxs = np.argsort(importances) 
plt.title('Feature Importances')
plt.barh(range(len(idxs)), importances[idxs], align='center') 
plt.yticks(range(len(idxs)), [col_names[i] for i in idxs]) 
plt.xlabel('Model name Feature Importance') 
plt.show()
 
PREVIOUS NEXT
Tagged: #How #plot #Feature #importance #model #python
ADD COMMENT
Topic
Name
3+1 =