WSYAM806 commited on
Commit
b359785
1 Parent(s): 3dd4830

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -45
app.py CHANGED
@@ -20,7 +20,7 @@ background-color: rgba(0,0,0,0);
20
 
21
  """
22
 
23
- Home, App, Result = st.tabs(['Home','App','Result'])
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
- 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
-
 
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")