Inside the smarter searches, and how far automation can go
The four iterations of the fundamental part, rerun from 100 random starting triples, 30 evaluations each, with Bayesian optimization (BO) and with random search. Share of runs that reached 0.81:
| within 10 | within 20 | within 30 | |
|---|---|---|---|
| BO, length scale 0.15 | 40% | 65% | 65% |
| BO, length scale 0.10 | 61% | 92% | 92% |
| random search | 37% | 54% | 65% |
| \(x\) | 0.1 | 0.25 | 0.5 | 0.7 | 0.9 |
|---|---|---|---|---|---|
| \(\ell / g\) | 0.03 | 1.24 | 0.45 | 5.73 | 0.09 |
Six hyperparameters: one matters a lot, one a little, four not at all. Best possible: 0.870. 20 seeds.
| mean best after | 10 | 20 | 40 | 60 trials |
|---|---|---|---|---|
| random | 0.812 | 0.819 | 0.830 | 0.843 |
| TPE | 0.812 | 0.847 | 0.857 | 0.860 |
Identical at 10: TPE's first 10 trials are random. After 40 it is above what random reaches after 60.
def build(trial):
family = trial.suggest_categorical('family', ['logistic', 'boosting'])
if family == 'logistic':
C = trial.suggest_float('C', 1e-3, 1e2, log=True)
return make_pipeline(FunctionTransformer(np.log1p), StandardScaler(),
LogisticRegression(C=C, max_iter=2000))
return HistGradientBoostingClassifier(
learning_rate=trial.suggest_float('learning_rate', 0.01, 0.5, log=True), ...)
C ≈ 0.03, 0.798, tied with the hand-picked booster; TPE spent 31 of its 40 trials on it. A space that leaves out the simple model can never tell you that you did not need the complicated one.trial.report).How aggressive should the tournament of successive halving be? Hyperband runs brackets of different aggressiveness, each costing about the same (Li et al., 2018).
| bracket | rounds (configurations × budget) | cost |
|---|---|---|
| s = 3 | 27 × 1 → 9 × 3 → 3 × 9 → 1 × 27 | 108 |
| s = 2 | 12 × 3 → 4 × 9 → 1 × 27 | 99 |
| s = 1 | 6 × 9 → 2 × 27 | 108 |
| s = 0 | 4 × 27 (plain random search) | 108 |
Combined Algorithm Selection and Hyperparameter optimization (Thornton et al., 2013).
| system | how it searches | what it returns |
|---|---|---|
| auto-sklearn | Bayesian optimization, warm-started on similar data sets | an ensemble (ensemble selection) |
| TPOT | genetic programming over pipeline trees | the best pipeline, as scikit-learn code |
| AutoGluon-Tabular | little search: bagging and multi-layer stacking | a stacked ensemble |
| FLAML | cost-aware: cheap configurations first | the best single model in a time budget |
what is predicted, for whom, when, and what an error costs
84.5% of kc1 modules are clean: a search on accuracy approves a model that never flags
groups, time order and leaks are exploited by the search, not corrected
removing one leaky column changed average precision by 0.18; tuning, by 0.007
And deployment: a stacked ensemble of 40 models may be the hardest to serve, explain and retrain.
cv.phoneme, continued: TPE with Optuna and successive halving join the grid and random search of steps 4 and 5, with the same budget.
Chosen by its cross-validation (CV) score: the halving winner, CV 0.9528, test area under the ROC curve (ROC AUC) 0.9455; the defaults drop as much (0.9468 → 0.9374).
Random search: best_score_ 0.9499; nested estimate 0.9472 ± 0.0067.
Same lab notebook, from step 6 (!pip install optuna). Simulations: trees as the budget (step 7) and the defaults on the same outer folds (step 10).
Pace: steps 6, 7 and the first simulation in 15 min; 8 and 9 in 10 min; step 10 and the second in 10 min.