Skip to content

Commit

Permalink
Update xgb cv to penalize instable training trials
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasMeissnerDS committed Jul 3, 2023
1 parent 3c16654 commit 7281e0e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bluecast/config/training_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class XgboostTuneParamsConfig:
lambda_min: float = 0.0
lambda_max: float = 10.0
num_leaves_min: int = 2
num_leaves_max: int = 256
num_leaves_max: int = 64
sub_sample_min: float = 0.3
sub_sample_max: float = 1.0
col_sample_by_tree_min: float = 0.3
Expand All @@ -57,7 +57,7 @@ class XgboostTuneParamsConfig:
eta_min: float = 0.001
eta_max: float = 0.3
steps_min: int = 2
steps_max: int = 50000
steps_max: int = 1000
model_verbosity: int = 0
model_objective: str = "multi:softprob"
model_eval_metric: str = "mlogloss"
Expand Down
2 changes: 1 addition & 1 deletion bluecast/ml_modelling/xgboost.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def objective(trial):
shuffle=self.conf_training.shuffle_during_training,
)

return result["test-mlogloss-mean"].mean()
return result["test-mlogloss-mean"].mean() + (result["test-mlogloss-mean"].std() ** 0.7)

algorithm = "xgboost"
sampler = optuna.samplers.TPESampler(
Expand Down
Binary file modified dist/bluecast-0.8-py3-none-any.whl
Binary file not shown.
Binary file modified dist/bluecast-0.8.tar.gz
Binary file not shown.

0 comments on commit 7281e0e

Please sign in to comment.