Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
| 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 |
|