Class or Function Names
- PercentilePruner
Example
import optuna
from optuna.pruners import PercentilePruner
def objective(trial):
s = 0
for step in range(20):
x = trial.suggest_float(f"x_{step}", -5, 5)
s += x**2
trial.report(s, step)
if trial.should_prune():
raise optuna.TrialPruned()
return s
pruner = PercentilePruner(25.0)
study = optuna.create_study(pruner=pruner)
study.optimize(objective, n_trials=20)
Others
See the documentation for more details.
- Package
- pruners/percentile
- Author
- Optuna team
- License
- MIT License
- Verified Optuna version
- 3.6.1
- Last update
- 2024-07-05