Truong-Phuc Nguyen
commited on
Commit
•
07e5bbb
1
Parent(s):
62afc58
Update Home.py
Browse files
Home.py
CHANGED
@@ -169,14 +169,24 @@ if predict:
|
|
169 |
X_6 = np.array([[vtn, vn, vcn, cl, ttp, ttt]])
|
170 |
X_6 = scaler_6.transform(X_6)
|
171 |
y_6 = clf_6.predict(X_6)
|
172 |
-
|
|
|
|
|
|
|
|
|
173 |
elif num_of_features == '8 measurements':
|
174 |
X_8 = np.array([[ttp, cl, cnnp, vn, vtn, cnnt, cntp, vcn]])
|
175 |
X_8 = scaler_8.transform(X_8)
|
176 |
y_8 = clf_8.predict(X_8)
|
177 |
-
st.success(f'We recommend you choosing **{convert_prediction(np.argmax(y_8, axis=1))}** size!')
|
|
|
|
|
|
|
178 |
else:
|
179 |
X_21 = np.array([[h, w, bmi, vtn, vn, vcn, cn, cnnp, cnnt, cntp, cntt, ccnp, ccnt, snt, sndp, sndt, xup, xut, cl, ttp, ttt]])
|
180 |
X_21 = scaler_21.transform(X_21)
|
181 |
y_21 = clf_21.predict(X_21)
|
182 |
-
st.success(f'We recommend you choosing **{convert_prediction(np.argmax(y_21, axis=1))}** size!')
|
|
|
|
|
|
|
|
169 |
X_6 = np.array([[vtn, vn, vcn, cl, ttp, ttt]])
|
170 |
X_6 = scaler_6.transform(X_6)
|
171 |
y_6 = clf_6.predict(X_6)
|
172 |
+
y_pred = convert_prediction(y_6)
|
173 |
+
# st.success(f'We recommend you choosing **{convert_prediction(y_6)}** size!')
|
174 |
+
styled_text = f"<h3 style='text-align: center;'>We recommend you choosing <span style='color: red; font-weight: bold;'>{y_pred}</span> size!</h3>"
|
175 |
+
st.markdown(styled_text, unsafe_allow_html=True)
|
176 |
+
|
177 |
elif num_of_features == '8 measurements':
|
178 |
X_8 = np.array([[ttp, cl, cnnp, vn, vtn, cnnt, cntp, vcn]])
|
179 |
X_8 = scaler_8.transform(X_8)
|
180 |
y_8 = clf_8.predict(X_8)
|
181 |
+
# st.success(f'We recommend you choosing **{convert_prediction(np.argmax(y_8, axis=1))}** size!')
|
182 |
+
y_pred = convert_prediction(y_8)
|
183 |
+
# st.success(f'We recommend you choosing **{convert_prediction(y_6)}** size!')
|
184 |
+
styled_text = f"<h3 style='text-align: center;'>We recommend you choosing <span style='color: red; font-weight: bold;'>{y_pred}</span> size!</h3>"
|
185 |
else:
|
186 |
X_21 = np.array([[h, w, bmi, vtn, vn, vcn, cn, cnnp, cnnt, cntp, cntt, ccnp, ccnt, snt, sndp, sndt, xup, xut, cl, ttp, ttt]])
|
187 |
X_21 = scaler_21.transform(X_21)
|
188 |
y_21 = clf_21.predict(X_21)
|
189 |
+
# st.success(f'We recommend you choosing **{convert_prediction(np.argmax(y_21, axis=1))}** size!')
|
190 |
+
y_pred = convert_prediction(y_21)
|
191 |
+
# st.success(f'We recommend you choosing **{convert_prediction(y_6)}** size!')
|
192 |
+
styled_text = f"<h3 style='text-align: center;'>We recommend you choosing <span style='color: red; font-weight: bold;'>{y_pred}</span> size!</h3>"
|