Skip to content

Instantly share code, notes, and snippets.

@PranjalDureja0002
Created March 15, 2021 09:59
Show Gist options
  • Save PranjalDureja0002/733adc1ea13bdd7e8efcf816060ba385 to your computer and use it in GitHub Desktop.
Save PranjalDureja0002/733adc1ea13bdd7e8efcf816060ba385 to your computer and use it in GitHub Desktop.
model
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