/Employee_attrition.py Secret
Created
November 21, 2020 06:35
Star
You must be signed in to star a gist
This file contains 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
trace = go.Scatter( | |
y = rf.feature_importances_, | |
x = attrition_final.columns.values, | |
mode='markers', | |
marker=dict( | |
sizemode = 'diameter', | |
sizeref = 1, | |
size = 13, | |
#size= rf.feature_importances_, | |
#color = np.random.randn(500), #set color equal to a variable | |
color = rf.feature_importances_, | |
colorscale='Portland', | |
showscale=True | |
), | |
text = attrition_final.columns.values | |
) | |
data = [trace] | |
layout= go.Layout( | |
autosize= True, | |
title= 'Random Forest Feature Importance', | |
hovermode= 'closest', | |
xaxis= dict( | |
ticklen= 5, | |
showgrid=False, | |
zeroline=False, | |
showline=False | |
), | |
yaxis=dict( | |
title= 'Feature Importance', | |
showgrid=False, | |
zeroline=False, | |
ticklen= 5, | |
gridwidth= 2 | |
), | |
showlegend= False | |
) | |
fig = go.Figure(data=data, layout=layout) | |
py.iplot(fig,filename='scatter2010') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment