paragon-analytics commited on
Commit
8742c0b
·
1 Parent(s): 287e288

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -55,7 +55,13 @@ def adr_predict(x):
55
  scores = tf.nn.softmax(scores)
56
 
57
  shap_values = explainer([str(x).lower()])
58
- local_plot = shap.plots.text(shap_values[0], display=False)
 
 
 
 
 
 
59
 
60
  # med = med_score(classifier(x+str(", There is a medication."))[0])
61
  # sym = sym_score(classifier(x+str(", There is a symptom."))[0])
 
55
  scores = tf.nn.softmax(scores)
56
 
57
  shap_values = explainer([str(x).lower()])
58
+ # # Find the index of the class you want as the default reference (e.g., 'label_1')
59
+ # label_1_index = np.where(np.array(explainer.output_names) == 'label_1')[0][0]
60
+
61
+ # # Plot the SHAP values for a specific instance in your dataset (e.g., instance 0)
62
+ # shap.plots.text(shap_values[label_1_index][0])
63
+
64
+ local_plot = shap.plots.text(shap_values[0][1], display=False)
65
 
66
  # med = med_score(classifier(x+str(", There is a medication."))[0])
67
  # sym = sym_score(classifier(x+str(", There is a symptom."))[0])