Created
March 15, 2021 09:59
-
-
Save PranjalDureja0002/733adc1ea13bdd7e8efcf816060ba385 to your computer and use it in GitHub Desktop.
model
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s1 = data['score'] | |
s_s1 = sum(s1.tolist()) | |
s_s1 | |
plt.style.use('fivethirtyeight') | |
ax=data.head(20).plot(kind = 'barh' , color = 'red') | |
for p in ax.patches: | |
percentage = '{:.1f}%'.format(100 * p.get_width()/s_s1) | |
x = p.get_x() + p.get_width() - 0.5 | |
y = p.get_y() + p.get_height() | |
ax.annotate(percentage, (x, y)) | |
plt.xlabel ('Score') | |
plt.ylabel ('Features') | |
plt.title('Feature_Importance_Plot',fontsize=20) | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment