AseemD commited on
Commit
a66b125
·
verified ·
1 Parent(s): 9f3b085

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
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
- fig = shap.force_plot(explainer.expected_value, shap_values[idx].values, X.iloc[idx], matplotlib=True, show=False)
97
- st.pyplot(fig, bbox_inches='tight')
98
  st.write("SHAP Summary Plot")
99
- fig =shap.summary_plot(shap_values, X, show=False)
100
- st.pyplot(fig, bbox_inches='tight')
101
  st.write("SHAP Bar Plot")
102
- fig =shap.summary_plot(shap_values, X, plot_type="bar", show=False)
103
- st.pyplot(fig, bbox_inches='tight')
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")