class optuna.integration.LightGBMPruningCallback(trial: optuna.trial._trial.Trial, metric: str, valid_name: str = 'valid_0')[source]

Callback for LightGBM to prune unpromising trials.

See the example if you want to add a pruning callback which observes AUC of a LightGBM model.

  • trial – A Trial corresponding to the current evaluation of the objective function.

  • metric – An evaluation metric for pruning, e.g., binary_error and multi_error. Please refer to LightGBM reference for further details.

  • valid_name – The name of the target validation. Validation names are specified by valid_names option of train method. If omitted, valid_0 is used which is the default name of the first validation. Note that this argument will be ignored if you are calling cv method instead of train method.

__init__(trial: optuna.trial._trial.Trial, metric: str, valid_name: str = 'valid_0')None[source]

Initialize self. See help(type(self)) for accurate signature.


__init__(trial, metric[, valid_name])

Initialize self.