Mummia-99 commited on
Commit
247e317
·
verified ·
1 Parent(s): 45af386

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -5
app.py CHANGED
@@ -84,11 +84,34 @@ if st.button("Submit"):
84
  e_salary=np.round(((e_salary-100090.239881)/57510.492818),3)
85
 
86
 
87
- output = bank_model.predict([[credit_score, geography_value, gender_value, age, tenure, balance, e_salary, active_holder_value]])
88
 
 
 
 
 
 
89
 
90
- if output ==0:
91
- st.write("The Customer is Interseted in our Bank")
92
- else:
93
- st.write("The Customer is Not Interseted in our Bank")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
 
 
84
  e_salary=np.round(((e_salary-100090.239881)/57510.492818),3)
85
 
86
 
87
+ prediction = bank_model.predict([[credit_score, geography_value, gender_value, age, tenure, balance, e_salary, active_holder_value]])
88
 
89
+ # Define messages and colors
90
+ review_status = {
91
+ 1: ("✅ The Customer is Interseted in our Bank", "#32CD32"), # Green
92
+ 0: ("❌ The Customer is Not Interseted in our Bank", "#FF4500") # Red-Orange
93
+ }
94
 
95
+ # Get message and color based on prediction
96
+ message, color = review_status.get(prediction, ("❓ Unknown Prediction", "#808080"))
97
+
98
+ # Display styled result
99
+ st.markdown(f"""
100
+ <div style="
101
+ padding: 15px;
102
+ background-color: {color};
103
+ border-radius: 10px;
104
+ text-align: center;
105
+ font-size: 18px;
106
+ font-weight: bold;
107
+ color: white;">
108
+ {message}
109
+ </div>
110
+ """, unsafe_allow_html=True)
111
+
112
+ except Exception as e:
113
+ st.error(f"⚠️ Error in prediction: {e}")
114
+
115
+ st.write("")
116
+
117