Dun3Co commited on
Commit
b29148a
·
verified ·
1 Parent(s): f75550d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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
- # Convert boolean target to integer
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