Successive halving
Quick answer
Successive halving starts many candidates with a small resource budget, evaluates them, and promotes only the stronger candidates to larger budgets. This trades broad early exploration for deeper evaluation of fewer candidates. Static examples tested locally with Python 3.13.5, scikit-learn 1.8.0 SciPy 1.17.0 and NumPy 2.3.5 where imported. ByteMind package execution is unverified.
Compute resource schedule
Observed local output:
8 10 804 20 802 40 801 80 80This idealized schedule uses 320 candidate-resource units before fold multipliers.
How it works
A resource can be training samples or an estimator setting such as n_estimators. With factor 2, a simplified exact schedule for 8 candidates uses 8 at 10 units, 4 at 20, 2 at 40 and 1 at 80. Each stage costs 80 candidate-resource units, not counting folds. Actual halving searches use integer rounding, resource limits and implementation-specific schedules; inspect n_candidates_, n_resources_ and cv_results_ rather than assuming this toy schedule. In scikit-learn 1.8 import sklearn.experimental.enable_halving_search_cv before importing HalvingGridSearchCV or HalvingRandomSearchCV. When resource is an estimator parameter it cannot also appear in the search grid. Use stable folds across repeated calls to split. Candidate rankings at small budgets may differ from full-budget rankings; aggressive elimination can discard the eventual best model. Halving may refit from scratch at each stage; do not assume checkpoint reuse. Report resource units, fold counts, actual fits and the final-stage selection separately.
Run experimental halving
from sklearn.experimental import enable_halving_search_cvfrom sklearn.model_selection import HalvingGridSearchCV,StratifiedKFoldfrom sklearn.ensemble import RandomForestClassifierfrom sklearn.datasets import make_classificationX,y=make_classification(n_samples=80,n_features=4,random_state=7)s=HalvingGridSearchCV(RandomForestClassifier(random_state=7,n_jobs=1),{"max_depth":[1,2,3,4]},resource="n_estimators",min_resources=4,max_resources=16,factor=2,cv=StratifiedKFold(2),scoring="accuracy",error_score="raise").fit(X,y)print([int(v) for v in s.n_candidates_],[int(v) for v in s.n_resources_])Observed local output:
[4, 2, 1] [4, 8, 16]The installed experimental implementation promotes four to two to one at increasing tree counts.
Common mistakes
Do not compare candidates at different resources as though scores were directly equivalent. Do not assume halving always saves wall time or that the first stage identifies the best full-budget model.
Practice and next steps
Compute the candidate-resource schedule for eight candidates, doubling resources each round. Explain what happens if a slowly learning candidate ranks last initially. Complete the knowledge check and staged exercise. Next: Trial budgets and early stopping.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Successive halving — knowledge check
Apply successive halving to new scenarios.
Why evaluate at small budgets first?
What risk arises?
Where is the experimental import required?
Can resource also be in the grid?
What should actual schedules come from?