MiyunKim commited on
Commit
2eb94cb
·
verified ·
1 Parent(s): 50e119b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -61,7 +61,8 @@ def adr_predict(x):
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], 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])
 
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
+ # Plot the SHAP values using custom color mapping (red for negative, blue for positive)
65
+ local_plot = shap.plots.text(shap_values[0], display=False, color=lambda v: 'blue' if v >= 0 else 'red')
66
 
67
  # med = med_score(classifier(x+str(", There is a medication."))[0])
68
  # sym = sym_score(classifier(x+str(", There is a symptom."))[0])