Spaces:
Sleeping
Sleeping
Upload 4 files
Browse files- trainer.py +2 -2
trainer.py
CHANGED
|
@@ -36,9 +36,9 @@ def prepare_data(df: pd.DataFrame, target_col: str):
|
|
| 36 |
# Detectar tipo de tarefa
|
| 37 |
task_type = detect_task_type(y)
|
| 38 |
|
| 39 |
-
# Encode target
|
| 40 |
label_encoder = None
|
| 41 |
-
if
|
| 42 |
label_encoder = LabelEncoder()
|
| 43 |
y = pd.Series(label_encoder.fit_transform(y))
|
| 44 |
|
|
|
|
| 36 |
# Detectar tipo de tarefa
|
| 37 |
task_type = detect_task_type(y)
|
| 38 |
|
| 39 |
+
# Encode target - sempre para classificação (XGBoost precisa de 0, 1, 2...)
|
| 40 |
label_encoder = None
|
| 41 |
+
if task_type == "classification":
|
| 42 |
label_encoder = LabelEncoder()
|
| 43 |
y = pd.Series(label_encoder.fit_transform(y))
|
| 44 |
|