hlnicholls commited on
Commit
900e37e
·
1 Parent(s): 28bf9df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -139,8 +139,11 @@ if len(gene_list) > 1:
139
  plotly_fig['layout'] = {'xaxis': {'title': 'SHAP value (impact on model output)'}}
140
  max_display=8
141
  feature_names=df_shap.columns
 
 
 
142
  text = [i for i in gene_list]
143
- text = iter(text)
144
  for i in range(1, len(plotly_fig['data']), 2):
145
  t = text.__next__()
146
  plotly_fig['data'][i]['name'] = ''
 
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]
145
  text = [i for i in gene_list]
146
+ #text = iter(text)
147
  for i in range(1, len(plotly_fig['data']), 2):
148
  t = text.__next__()
149
  plotly_fig['data'][i]['name'] = ''