EdwinLH commited on
Commit
eb1a65f
·
verified ·
1 Parent(s): 299c10a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -376,7 +376,13 @@ def predict_single(
376
  "Predicted Class": int(y_pred[0]),
377
  "Probability": round(float(y_proba[0]), 4)
378
  }
379
- return result
 
 
 
 
 
 
380
 
381
 
382
  # ------------------- UI Components -------------------
 
376
  "Predicted Class": int(y_pred[0]),
377
  "Probability": round(float(y_proba[0]), 4)
378
  }
379
+
380
+ # Create results DataFrame
381
+ results_df = X_input.copy()
382
+ results_df["Predicted"] = y_pred
383
+ results_df["Probability"] = y_proba.round(4)
384
+
385
+ return results_df.to_dict(orient="records") # return as JSON-friendly format
386
 
387
 
388
  # ------------------- UI Components -------------------