Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ background-color: rgba(0,0,0,0);
|
|
20 |
|
21 |
"""
|
22 |
|
23 |
-
Home, App
|
24 |
|
25 |
with Home:
|
26 |
st.title("Final Project - Uncover potential insights 1999 Czech Bank Financial Dataset ")
|
@@ -108,47 +108,39 @@ with App:
|
|
108 |
|
109 |
prediction = pipeline.predict(input)
|
110 |
input['cluster'] = prediction
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
val_mg_def = val_mg['Features'].split(',')
|
148 |
-
print(f'Features :\n')
|
149 |
-
for j in val_mg_def:
|
150 |
-
j = j.strip(" '\"[]")
|
151 |
-
print('*', j)
|
152 |
-
# Print a separator
|
153 |
-
print("\n----------------\n")
|
154 |
-
|
|
|
20 |
|
21 |
"""
|
22 |
|
23 |
+
Home, App = st.tabs(['Home','App'])
|
24 |
|
25 |
with Home:
|
26 |
st.title("Final Project - Uncover potential insights 1999 Czech Bank Financial Dataset ")
|
|
|
108 |
|
109 |
prediction = pipeline.predict(input)
|
110 |
input['cluster'] = prediction
|
111 |
+
st.write('Account Cluser Status : ', prediction)
|
112 |
+
st.write("\n----------------\n")
|
113 |
+
for index, values in input.iterrows():
|
114 |
+
for idx_ps, val_ps in pension.iterrows():
|
115 |
+
if values['cluster'] == val_ps['Cluster']:
|
116 |
+
st.write(f'For account : ', values['account_id'])
|
117 |
+
st.write('Based on the client characteristic, here are the pension package product to offer :\n')
|
118 |
+
st.write(f"Product Name: {val_ps['Product Name']} \n")
|
119 |
+
val_ps_def = val_ps['Features'].split(',')
|
120 |
+
st.write(f'Features :\n')
|
121 |
+
for i in val_ps_def:
|
122 |
+
i = i.strip(" '\"[]")
|
123 |
+
st.write('*', i)
|
124 |
+
st.write("\n----------------\n")
|
125 |
+
for idx_iv, val_iv in investment.iterrows():
|
126 |
+
if values['cluster'] == val_iv['Cluster']:
|
127 |
+
st.write(f'For account : ', values['account_id'])
|
128 |
+
st.write('Based on the client characteristic, here are the investment package product to offer :\n')
|
129 |
+
st.write(f"Product Name: {val_iv['Product Name']} \n")
|
130 |
+
val_iv_def = val_iv['Features'].split(',')
|
131 |
+
st.write(f'Features :\n')
|
132 |
+
for h in val_iv_def:
|
133 |
+
h = h.strip(" '\"[]")
|
134 |
+
st.write('*', h)
|
135 |
+
st.write("\n----------------\n")
|
136 |
+
for idx_mg, val_mg in mortgage.iterrows():
|
137 |
+
if values['cluster'] == val_mg['Cluster']:
|
138 |
+
st.write(f'For account : ', values['account_id'])
|
139 |
+
st.write('Based on the client characteristic, here are the mortgage package product to offer :\n')
|
140 |
+
st.write(f"Product Name: {val_mg['Product Name']} \n")
|
141 |
+
val_mg_def = val_mg['Features'].split(',')
|
142 |
+
st.write(f'Features :\n')
|
143 |
+
for j in val_mg_def:
|
144 |
+
j = j.strip(" '\"[]")
|
145 |
+
st.write('*', j)
|
146 |
+
st.write("\n----------------\n")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|