hlnicholls commited on
Commit
75811ee
·
1 Parent(s): 0072995

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -139,14 +139,13 @@ 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
- #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
- for gene in gene_list:
149
- t = gene #text.__next__()
150
  plotly_fig['data'][i]['name'] = ''
151
  plotly_fig['data'][i]['text'] = t
152
  plotly_fig['data'][i]['hoverinfo'] = 'text'
 
139
  plotly_fig['layout'] = {'xaxis': {'title': 'SHAP value (impact on model output)'}}
140
  max_display=8
141
  feature_names=df_shap.columns
142
+ gene_index = df_shap.index
143
+ #feature_order = np.argsort(np.sum(np.abs(shap_values), axis=0)[:-1])
144
+ #feature_order = feature_order[-min(max_display, len(feature_order)):]
145
+ #text = [feature_names[i] for i in feature_order]
146
+ #text = iter(text)
147
  for i in range(1, len(plotly_fig['data']), 2):
148
+ t = gene_index #plotly_fig['data']
 
149
  plotly_fig['data'][i]['name'] = ''
150
  plotly_fig['data'][i]['text'] = t
151
  plotly_fig['data'][i]['hoverinfo'] = 'text'