WSYAM806 commited on
Commit
3dd4830
·
1 Parent(s): 4c056e3

Update app.py

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