diff --git a/dashboard_CLOUD.py b/dashboard_CLOUD.py index 71a867f..f3d82a2 100644 --- a/dashboard_CLOUD.py +++ b/dashboard_CLOUD.py @@ -407,6 +407,42 @@ def main(): st.markdown("---") st.write(f"The probability of default on the loan is estimated to be {probability_class1 * 100:.2f}% (Threshold: {optimal_threshold * 100:.2f}%).") + + + # Define gauge parameters (feel free to customize) + gauge_min = 0.0 # Minimum value for the score + gauge_max = 1.0 # Maximum value for the score + gauge_size = 200 # Size of the gauge in pixels + + # Define gauge value and color based on score + gauge_value = probability_class1 + if prediction_label == "Accepted": + gauge_color = "green" # Green for accepted loans + else: + gauge_color = "red" # Red for declined loans + + # Calculate position for text elements (adjust as needed) + text_offset_y = gauge_size * 0.2 # Vertical offset for text + text_size = gauge_size * 0.15 # Font size for text + + # Create colored gauge HTML with text elements + gauge_html = f""" +
+
+
+
+

{probability_class1 * 100:.2f}%

+

Threshold: {optimal_threshold * 100:.2f}%

+
+ """ + + + + + + + + if prediction_label == "Accepted": st.markdown("

The loan application is approved.

", unsafe_allow_html=True) else: