shubham680 commited on
Commit
b9dcb0f
Β·
verified Β·
1 Parent(s): 31364e1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -4
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
- st.write("Prediction:",type(knn.predict(final_input)))
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