WSYAM806 commited on
Commit
721823e
·
1 Parent(s): 2c4d935

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -10
app.py CHANGED
@@ -110,18 +110,16 @@ with App:
110
  def_cluster = input.drop(columns=[col for col in input.columns if col not in num_col])
111
  def_pca = cluster.transform(def_cluster)
112
  labelz = k_3.transform(def_pca)
113
-
114
- if np.any(labelz == 0):
115
- labelz = 'Moderate-Risk Customers'
116
- elif np.any(labelz == 1):
117
- labelz = 'Low-Risk Customers'
118
- elif np.any(labelz==2):
119
- labelz = 'High-Risk Customers'
 
120
  input['cluster'] = labelz
121
 
122
- st.write('Based on user input, the placement cluster: ')
123
- st.write(labelz)
124
-
125
  if st.button('predict'):
126
  prediction = model.predict(input)
127
 
 
110
  def_cluster = input.drop(columns=[col for col in input.columns if col not in num_col])
111
  def_pca = cluster.transform(def_cluster)
112
  labelz = k_3.transform(def_pca)
113
+
114
+ for i in labelz:
115
+ if i == 0:
116
+ st.write('Based on user input, the placement cluster: Moderate-Risk Customers')
117
+ elif i == 1:
118
+ st.write('Based on user input, the placement cluster: Low-Risk Customers')
119
+ elif i == 2:
120
+ st.write('Based on user input, the placement cluster: High-Risk Customers')
121
  input['cluster'] = labelz
122
 
 
 
 
123
  if st.button('predict'):
124
  prediction = model.predict(input)
125