Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -107,47 +107,48 @@ with App:
|
|
| 107 |
progress_bar.progress(perc_completed+1)
|
| 108 |
|
| 109 |
prediction = pipeline.predict(input)
|
| 110 |
-
|
| 111 |
|
| 112 |
|
| 113 |
with Result:
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
for
|
| 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 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
|
|
|
| 153 |
|
|
|
|
| 107 |
progress_bar.progress(perc_completed+1)
|
| 108 |
|
| 109 |
prediction = pipeline.predict(input)
|
| 110 |
+
input['cluster'] = prediction
|
| 111 |
|
| 112 |
|
| 113 |
with Result:
|
| 114 |
+
if st.button('Result'):
|
| 115 |
+
print('Account Cluser Status : ', prediction)
|
| 116 |
+
print("\n----------------\n")
|
| 117 |
+
for index, values in input.iterrows():
|
| 118 |
+
for idx_ps, val_ps in pension.iterrows():
|
| 119 |
+
if values['cluster'] == val_ps['Cluster']:
|
| 120 |
+
print(f'For account : ', values['account_id'])
|
| 121 |
+
print('Based on the client characteristic, here are the pension package product to offer :\n')
|
| 122 |
+
print(f"Product Name: {val_ps['Product Name']} \n")
|
| 123 |
+
val_ps_def = val_ps['Features'].split(',')
|
| 124 |
+
print(f'Features :\n')
|
| 125 |
+
for i in val_ps_def:
|
| 126 |
+
i = i.strip(" '\"[]")
|
| 127 |
+
print('*', i)
|
| 128 |
+
# Print a separator
|
| 129 |
+
print("\n----------------\n")
|
| 130 |
+
for idx_iv, val_iv in investment.iterrows():
|
| 131 |
+
if values['cluster'] == val_iv['Cluster']:
|
| 132 |
+
print(f'For account : ', values['account_id'])
|
| 133 |
+
print('Based on the client characteristic, here are the investment package product to offer :\n')
|
| 134 |
+
print(f"Product Name: {val_iv['Product Name']} \n")
|
| 135 |
+
val_iv_def = val_iv['Features'].split(',')
|
| 136 |
+
print(f'Features :\n')
|
| 137 |
+
for h in val_iv_def:
|
| 138 |
+
h = h.strip(" '\"[]")
|
| 139 |
+
print('*', h)
|
| 140 |
+
# Print a separator
|
| 141 |
+
print("\n----------------\n")
|
| 142 |
+
for idx_mg, val_mg in mortgage.iterrows():
|
| 143 |
+
if values['cluster'] == val_mg['Cluster']:
|
| 144 |
+
print(f'For account : ', values['account_id'])
|
| 145 |
+
print('Based on the client characteristic, here are the mortgage package product to offer :\n')
|
| 146 |
+
print(f"Product Name: {val_mg['Product Name']} \n")
|
| 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 |
|