optuna.pruners

The pruners module defines a BasePruner class characterized by an abstract prune() method, which, for a given trial and its associated study, returns a boolean value representing whether the trial should be pruned. This determination is made based on stored intermediate values of the objective function, as previously reported for the trial using optuna.trial.Trial.report(). The remaining classes in this module represent child classes, inheriting from BasePruner, which implement different pruning strategies.

Warning

Currently pruners module is expected to be used only for single-objective optimization.

See also

Efficient Optimization Algorithms tutorial explains the concept of the pruner classes and a minimal example.

See also

User-Defined Pruner tutorial could be helpful if you want to implement your own pruner classes.

optuna.pruners.BasePruner

Base class for pruners.

optuna.pruners.MedianPruner

Pruner using the median stopping rule.

optuna.pruners.NopPruner

Pruner which never prunes trials.

optuna.pruners.PatientPruner

Pruner which wraps another pruner with tolerance.

optuna.pruners.PercentilePruner

Pruner to keep the specified percentile of the trials.

optuna.pruners.SuccessiveHalvingPruner

Pruner using Asynchronous Successive Halving Algorithm.

optuna.pruners.HyperbandPruner

Pruner using Hyperband.

optuna.pruners.ThresholdPruner

Pruner to detect outlying metrics of the trials.

optuna.pruners.WilcoxonPruner

Pruner based on the Wilcoxon signed-rank test.