Spaces:
Sleeping
Sleeping
feat: optimize Gradient Boosting and XGBoost parameters for improved model performance
Browse files- app/training/train_classifier.py +23 -21
app/training/train_classifier.py
CHANGED
|
@@ -265,10 +265,12 @@ def _build_candidates() -> list[tuple[str, Any]]:
|
|
| 265 |
(
|
| 266 |
"Gradient Boosting",
|
| 267 |
GradientBoostingClassifier(
|
| 268 |
-
n_estimators=
|
| 269 |
-
max_depth=
|
| 270 |
learning_rate=0.1,
|
| 271 |
-
subsample=0.
|
|
|
|
|
|
|
| 272 |
random_state=42,
|
| 273 |
),
|
| 274 |
),
|
|
@@ -303,15 +305,15 @@ def _build_candidates() -> list[tuple[str, Any]]:
|
|
| 303 |
candidates.append((
|
| 304 |
"XGBoost",
|
| 305 |
xgb.XGBClassifier(
|
| 306 |
-
n_estimators=
|
| 307 |
-
max_depth=
|
| 308 |
-
learning_rate=0.
|
| 309 |
-
subsample=0.
|
| 310 |
-
colsample_bytree=0.
|
| 311 |
-
min_child_weight=
|
| 312 |
-
reg_alpha=0.
|
| 313 |
-
reg_lambda=
|
| 314 |
-
gamma=0.
|
| 315 |
scale_pos_weight=1.0,
|
| 316 |
eval_metric="logloss",
|
| 317 |
random_state=42,
|
|
@@ -323,15 +325,15 @@ def _build_candidates() -> list[tuple[str, Any]]:
|
|
| 323 |
candidates.append((
|
| 324 |
"LightGBM",
|
| 325 |
lgb.LGBMClassifier(
|
| 326 |
-
n_estimators=
|
| 327 |
-
max_depth=
|
| 328 |
-
learning_rate=0.
|
| 329 |
-
num_leaves=
|
| 330 |
-
subsample=0.
|
| 331 |
-
colsample_bytree=0.
|
| 332 |
-
min_child_weight=
|
| 333 |
-
reg_alpha=0.
|
| 334 |
-
reg_lambda=
|
| 335 |
class_weight="balanced",
|
| 336 |
random_state=42,
|
| 337 |
verbose=-1,
|
|
|
|
| 265 |
(
|
| 266 |
"Gradient Boosting",
|
| 267 |
GradientBoostingClassifier(
|
| 268 |
+
n_estimators=150,
|
| 269 |
+
max_depth=3,
|
| 270 |
learning_rate=0.1,
|
| 271 |
+
subsample=0.7,
|
| 272 |
+
min_samples_leaf=20,
|
| 273 |
+
min_samples_split=30,
|
| 274 |
random_state=42,
|
| 275 |
),
|
| 276 |
),
|
|
|
|
| 305 |
candidates.append((
|
| 306 |
"XGBoost",
|
| 307 |
xgb.XGBClassifier(
|
| 308 |
+
n_estimators=150,
|
| 309 |
+
max_depth=3,
|
| 310 |
+
learning_rate=0.1,
|
| 311 |
+
subsample=0.7,
|
| 312 |
+
colsample_bytree=0.7,
|
| 313 |
+
min_child_weight=10,
|
| 314 |
+
reg_alpha=0.5,
|
| 315 |
+
reg_lambda=2.0,
|
| 316 |
+
gamma=0.3,
|
| 317 |
scale_pos_weight=1.0,
|
| 318 |
eval_metric="logloss",
|
| 319 |
random_state=42,
|
|
|
|
| 325 |
candidates.append((
|
| 326 |
"LightGBM",
|
| 327 |
lgb.LGBMClassifier(
|
| 328 |
+
n_estimators=150,
|
| 329 |
+
max_depth=3,
|
| 330 |
+
learning_rate=0.1,
|
| 331 |
+
num_leaves=8,
|
| 332 |
+
subsample=0.7,
|
| 333 |
+
colsample_bytree=0.7,
|
| 334 |
+
min_child_weight=10,
|
| 335 |
+
reg_alpha=0.5,
|
| 336 |
+
reg_lambda=2.0,
|
| 337 |
class_weight="balanced",
|
| 338 |
random_state=42,
|
| 339 |
verbose=-1,
|