hlnicholls commited on
Commit
cb40cbd
·
1 Parent(s): 255124e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -134,10 +134,11 @@ if len(gene_list) > 1:
134
  st.caption("SHAP Summary Plot of All Input Genes")
135
  st.pyplot(fig=summary_plot)
136
  st.caption("Interactive SHAP Summary Plot of All Input Genes")
137
- mpl_fig = shap_summary_plot(shap_values, df_shap, max_display=8, show=False)
138
  plotly_fig = tls.mpl_to_plotly(mpl_fig)
139
  plotly_fig['layout'] = {'xaxis': {'title': 'SHAP value (impact on model output)'}}
140
  max_display=8
 
141
  feature_order = np.argsort(np.sum(np.abs(shap_values), axis=0)[:-1])
142
  feature_order = feature_order[-min(max_display, len(feature_order)):]
143
  text = [feature_names[i] for i in feature_order]
 
134
  st.caption("SHAP Summary Plot of All Input Genes")
135
  st.pyplot(fig=summary_plot)
136
  st.caption("Interactive SHAP Summary Plot of All Input Genes")
137
+ mpl_fig = shap_summary_plot(shap_values, df_shap, max_display=8, show=False, feature_names=df_shap.columns)
138
  plotly_fig = tls.mpl_to_plotly(mpl_fig)
139
  plotly_fig['layout'] = {'xaxis': {'title': 'SHAP value (impact on model output)'}}
140
  max_display=8
141
+ feature_names=df_shap.columns
142
  feature_order = np.argsort(np.sum(np.abs(shap_values), axis=0)[:-1])
143
  feature_order = feature_order[-min(max_display, len(feature_order)):]
144
  text = [feature_names[i] for i in feature_order]