Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -180,8 +180,8 @@ def metrics(batch: Optional[BatchInputData] = None, limit: int = 100):
|
|
| 180 |
if "y" not in X.columns:
|
| 181 |
return {"error": "No target column 'y' found in dataset."}
|
| 182 |
|
| 183 |
-
#
|
| 184 |
-
y_true = X["y"].tolist()
|
| 185 |
print(f"[DEBUG] Found {sum(y_true)} positive cases out of {len(y_true)}")
|
| 186 |
X = X.drop(columns=["y"])
|
| 187 |
|
|
|
|
| 180 |
if "y" not in X.columns:
|
| 181 |
return {"error": "No target column 'y' found in dataset."}
|
| 182 |
|
| 183 |
+
# Robust conversion to int
|
| 184 |
+
y_true = X["y"].map(lambda v: 1 if v in [True, "True", "true", 1] else 0).tolist()
|
| 185 |
print(f"[DEBUG] Found {sum(y_true)} positive cases out of {len(y_true)}")
|
| 186 |
X = X.drop(columns=["y"])
|
| 187 |
|