dvj4 commited on
Commit
e94e786
·
1 Parent(s): 9a580cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -40,9 +40,12 @@ prediction = model.predict(input_df)
40
  st.write(f"The estimated house price range is ${prediction[0]:,.2f}")
41
  explainer = shap.Explainer(model, X_train)
42
  shap_values = explainer(X_test)
43
- fig, ax = plt.subplots()
44
  shap.summary_plot(shap_values, X_test, plot_type="bar", show=False)
45
- st.pyplot(fig, bbox_inches='tight')
46
- fig2, ax2 = plt.subplots()
47
  shap.plots.beeswarm(shap_values, show=False)
48
- st.pyplot(fig2, bbox_inches='tight')
 
 
 
 
40
  st.write(f"The estimated house price range is ${prediction[0]:,.2f}")
41
  explainer = shap.Explainer(model, X_train)
42
  shap_values = explainer(X_test)
43
+
44
  shap.summary_plot(shap_values, X_test, plot_type="bar", show=False)
45
+ st.pyplot(bbox_inches='tight')
46
+
47
  shap.plots.beeswarm(shap_values, show=False)
48
+ st.pyplot(bbox_inches='tight')
49
+
50
+ shap.plots.waterfall(shap_values[0])
51
+ st.pyplot(bbox_inches='tight')