Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 -------------------
|