hiyata commited on
Commit
0eb9745
·
verified ·
1 Parent(s): 2d04130

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
app.py CHANGED
@@ -176,6 +176,8 @@ def predict(file_obj):
176
  data=np.array([raw_freq_vector[kmer_dict[feat]] if feat != "Others" else np.sum(raw_freq_vector[others_mask]) for feat in top_features]),
177
  feature_names=top_features
178
  )
 
 
179
 
180
  # Generate waterfall plot using SHAP's legacy function
181
  fig = shap.plots._waterfall.waterfall_legacy(explanation, show=False)
 
176
  data=np.array([raw_freq_vector[kmer_dict[feat]] if feat != "Others" else np.sum(raw_freq_vector[others_mask]) for feat in top_features]),
177
  feature_names=top_features
178
  )
179
+ # Manually set expected_value to satisfy waterfall_legacy requirements
180
+ explanation.expected_value = 0
181
 
182
  # Generate waterfall plot using SHAP's legacy function
183
  fig = shap.plots._waterfall.waterfall_legacy(explanation, show=False)