Mummia-99 commited on
Commit
3b6385c
·
verified ·
1 Parent(s): 55c37bb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -21
app.py CHANGED
@@ -84,31 +84,31 @@ if st.button("Submit"):
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
  st.write(prediction)
90
- # # Define messages and colors
91
- # review_status = {
92
- # 1: ("✅ The Customer is Interseted in our Bank", "#32CD32"), # Green
93
- # 0: ("❌ The Customer is Not Interseted in our Bank", "#FF4500") # Red-Orange
94
- # }
95
 
96
- # # Get message and color based on prediction
97
- # message, color = review_status.get(prediction, ("❓ Unknown Prediction", "#808080"))
98
 
99
- # # Display styled result
100
- # st.markdown(f"""
101
- # <div style="
102
- # padding: 15px;
103
- # background-color: {color};
104
- # border-radius: 10px;
105
- # text-align: center;
106
- # font-size: 18px;
107
- # font-weight: bold;
108
- # color: white;">
109
- # {message}
110
- # </div>
111
- # """, unsafe_allow_html=True)
112
 
113
  except Exception as e:
114
  st.error(f"⚠️ Error in prediction: {e}")
 
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]])[0]
88
 
89
  st.write(prediction)
90
+ # Define messages and colors
91
+ review_status = {
92
+ 1: ("✅ The Customer is Interseted in our Bank", "#32CD32"), # Green
93
+ 0: ("❌ The Customer is Not Interseted in our Bank", "#FF4500") # Red-Orange
94
+ }
95
 
96
+ # Get message and color based on prediction
97
+ message, color = review_status.get(prediction, ("❓ Unknown Prediction", "#808080"))
98
 
99
+ # Display styled result
100
+ st.markdown(f"""
101
+ <div style="
102
+ padding: 15px;
103
+ background-color: {color};
104
+ border-radius: 10px;
105
+ text-align: center;
106
+ font-size: 18px;
107
+ font-weight: bold;
108
+ color: white;">
109
+ {message}
110
+ </div>
111
+ """, unsafe_allow_html=True)
112
 
113
  except Exception as e:
114
  st.error(f"⚠️ Error in prediction: {e}")