Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,14 +93,14 @@ def main():
|
|
| 93 |
# Visualize SHAP values
|
| 94 |
idx = st.slider("Select Test Instance", 0, len(X) - 1, 0)
|
| 95 |
st.write("SHAP Force Plot for a Single Prediction")
|
| 96 |
-
|
| 97 |
-
st.pyplot(
|
| 98 |
st.write("SHAP Summary Plot")
|
| 99 |
-
|
| 100 |
-
st.pyplot(
|
| 101 |
st.write("SHAP Bar Plot")
|
| 102 |
-
|
| 103 |
-
st.pyplot(
|
| 104 |
|
| 105 |
elif method == "LIME":
|
| 106 |
st.subheader("3. Interpretability using LIME")
|
|
|
|
| 93 |
# Visualize SHAP values
|
| 94 |
idx = st.slider("Select Test Instance", 0, len(X) - 1, 0)
|
| 95 |
st.write("SHAP Force Plot for a Single Prediction")
|
| 96 |
+
fig1 = shap.force_plot(explainer.expected_value, shap_values[idx].values, X.iloc[idx], matplotlib=True, show=False)
|
| 97 |
+
st.pyplot(fig1)
|
| 98 |
st.write("SHAP Summary Plot")
|
| 99 |
+
fig2 =shap.summary_plot(shap_values, X, show=False)
|
| 100 |
+
st.pyplot(fig2)
|
| 101 |
st.write("SHAP Bar Plot")
|
| 102 |
+
fig3 =shap.summary_plot(shap_values, X, plot_type="bar", show=False)
|
| 103 |
+
st.pyplot(fig3)
|
| 104 |
|
| 105 |
elif method == "LIME":
|
| 106 |
st.subheader("3. Interpretability using LIME")
|