Update app.py
Browse files
app.py
CHANGED
|
@@ -214,10 +214,9 @@ with st.container():
|
|
| 214 |
result_placeholder = st.empty() # π Reserve space near the button
|
| 215 |
|
| 216 |
if st.button("π Predict", key="predict", help="Click to see your personality"):
|
| 217 |
-
prediction = knn.predict(final_input)[0]
|
| 218 |
-
proba = knn.predict_proba(final_input)[0]
|
| 219 |
-
|
| 220 |
-
st.write("proba",type(knn.predict_proba(final_input)))
|
| 221 |
|
| 222 |
label = prediction_labels.get(prediction, "β Unknown")
|
| 223 |
confidence = proba[prediction] * 100
|
|
|
|
| 214 |
result_placeholder = st.empty() # π Reserve space near the button
|
| 215 |
|
| 216 |
if st.button("π Predict", key="predict", help="Click to see your personality"):
|
| 217 |
+
prediction = knn.predict(final_input)[0] # --> return 1d array further taking it as scalar value
|
| 218 |
+
proba = knn.predict_proba(final_input)[0] # --> returns 2d array containing both probablity taking as 1d array.
|
| 219 |
+
|
|
|
|
| 220 |
|
| 221 |
label = prediction_labels.get(prediction, "β Unknown")
|
| 222 |
confidence = proba[prediction] * 100
|