optuna_integration.XGBoostPruningCallback
- class optuna_integration.XGBoostPruningCallback(trial, observation_key)[source]
Callback for XGBoost to prune unpromising trials.
See the example if you want to add a pruning callback which observes validation accuracy of a XGBoost model.
- Parameters:
trial (optuna.trial.Trial) – A
Trial
corresponding to the current evaluation of the objective function.observation_key (str) – An evaluation metric for pruning, e.g.,
validation-error
andvalidation-merror
. When using the Scikit-Learn API, the index number ofeval_set
must be included in theobservation_key
, e.g.,validation_0-error
andvalidation_0-merror
. Please refer toeval_metric
in XGBoost reference for further details.