Spaces:
Running
Running
Update app.py
Browse files
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)
|