dvj4 commited on
Commit
07845c5
·
1 Parent(s): e94e786

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -40,12 +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
-
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')
 
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')
49
+ fig3, ax3 = plt.subplots()
50
  shap.plots.waterfall(shap_values[0])
51
+ st.pyplot(fig3, bbox_inches='tight')