Skip to content

Commit

Permalink
Update dashboard_CLOUD.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Isdinval authored Jun 6, 2024
1 parent 29143a3 commit 7781fb5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions dashboard_CLOUD.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,7 @@ def generate_bivariate_plot(feature1_values, feature2_values, customer_data, sk_
# PREDICTION USING MODEL FOR SELECTED CUSTOMER
# =========================================================================
st.header("IV. Model Prediction - Probability of Default ")
st.subheader("IV.1. Probability of Loan Default")
input_df = pd.DataFrame([input_data])
probability_class1 = model.predict_proba(input_df)[:, 1] # Get the raw prediction score

Expand Down Expand Up @@ -508,6 +509,7 @@ def generate_bivariate_plot(feature1_values, feature2_values, customer_data, sk_
# SHAP VALUES FOR SELECTED CUSTOMER
# =========================================================================
# SHAP VALUES
st.subheader("IV.2. Importance Feature Analysis (SHAP)")
final_estimator = get_final_estimator(model)
explainer = shap.TreeExplainer(final_estimator)
shap_values = explainer.shap_values(input_df)
Expand All @@ -519,6 +521,7 @@ def generate_bivariate_plot(feature1_values, feature2_values, customer_data, sk_
# TOP 10 POSITIVE OR NEGATIVE FEATURES
# TABLE and MODIFICATION OF VALUES
# =========================================================================
st.subheader("IV.3. Modify Features Value & Re-Predict")
# Create two columns for the plots
col1, col2 = st.columns(2)

Expand Down

0 comments on commit 7781fb5

Please sign in to comment.