Hyperparameter Optimisation

Hyperparameter optimisation is the search for machine learning model settings, such as those of a screening classifier, that perform best on held-out data.

Status
Published, version 1.0.0
Last reviewed
10 Nov 2026, by Dr Darrin Baines
Report a problem
Tell us if something is wrong or out of date

Concept Architecture

Hyperparameter Optimisation for Screening and Prediction Models

Hyperparameter optimisation fits the same learning algorithm many times under different settings, scores each fitted model on data kept out of training and keeps the setting that scores best. In HTA work the models tuned this way are mostly traditional machine learning models, such as classifiers that rank abstracts for a systematic review or gradient boosting models fitted to real-world data. The winning score is the best of many tries, so it flatters the model unless the final test uses data the search never touched. NICE ECD20 (2026), the NICE framework on AI methods for evidence, counts hyperparameter optimisation as tuning of traditional models and keeps it apart from Fine-Tuning, the tuning step for a large language model.

The outer loop around model fitting

A learning algorithm estimates parameters such as regression coefficients from training data, but some settings are fixed before fitting starts, such as the penalty in a penalised regression or the learning rate of gradient descent. These are the hyperparameters, covered on the Hyperparameter page in this glossary. Bergstra and Bengio describe choosing them as an outer optimisation wrapped around the inner fitting problem, and write the version used in practice as

λ^=arg⁡min⁡λ∈{λ(1),…,λ(S)}1∣X(valid)∣∑x∈X(valid)L(x; Aλ(X(train)))\hat{\lambda} = \arg\min_{\lambda \in \{\lambda^{(1)}, \dots, \lambda^{(S)}\}} \frac{1}{|X^{(\text{valid})}|} \sum_{x \in X^{(\text{valid})}} L\left(x;\, A_{\lambda}\left(X^{(\text{train})}\right)\right)

where λ^\hat{\lambda} is the chosen configuration, λ(1),…,λ(S)\lambda^{(1)}, \dots, \lambda^{(S)} are the SS configurations tried, AλA_{\lambda} is the learning algorithm with its hyperparameters set to λ\lambda, X(train)X^{(\text{train})} is the training data, X(valid)X^{(\text{valid})} is the validation data, ∣X(valid)∣|X^{(\text{valid})}| is the number of validation records, xx is one validation record and LL is the loss, for example 1 for a misclassified abstract and 0 otherwise.

Bergstra and Bengio note that the validation loss is unbiased as long as the validation data are independent of everything the algorithm used. Feurer and Hutter add that the gradient of the loss with respect to the hyperparameters is usually unavailable, so each fit is treated as a black box.

Search strategies and the budget they spend

Every strategy spends a budget of model fits. They differ in how the next configuration is chosen.

  • Grid search tries every combination of preset values. Feurer and Hutter note that with BB fits and NN hyperparameters a grid affords only B1/NB^{1/N} distinct values of each.
  • Random search draws configurations at random. Bergstra and Bengio found that on most datasets only a few hyperparameters mattered, different ones on different datasets, and that random search matched or beat grid search on neural networks in a small fraction of the computing time.
  • Bayesian optimisation fits a surrogate, often a Gaussian process, to the scores seen so far and uses it to pick the next configuration.
  • Multi-fidelity methods score many configurations cheaply, for example on a subset of data, and give more budget to promising ones. Li and colleagues reported that their Hyperband method gave speedups of more than an order of magnitude on some problems compared with popular Bayesian optimisation methods.

Tuning is not always worth its cost. In a benchmark of six algorithms on 38 datasets, Probst, Boulesteix and Bischl found elastic net and support vector machines much more tunable than the others and random forests the least tunable.

Keeping tuning apart from the performance estimate

The validation score of the winning configuration is a maximum over many noisy scores. Varma and Simon tuned two classifiers by cross-validation on simulated data in which the two classes did not differ at all. The tuned cross-validated error was below 30% on 18.5% of datasets for one classifier and 38% for the other, yet both performed no better than chance on independent test data. A nested procedure, with tuning repeated in an inner loop inside each outer fold, gave an estimate very close to the independent test result. Feurer and Hutter call this overfitting the hyperparameters to a finite validation set.

NICE ECD20 (2026) requires that the data used to select, train, optimise, customise and validate a model be independent of one another, and names holdout and cross-validation as ways to draw such data from one population. The TRIPOD+AI reporting guideline of Collins and colleagues says data used to evaluate a model should not overlap in participants with the data used to tune its hyperparameters. The data are therefore split three ways, or nested cross-validation is used when data are scarce, and the test set is opened once after tuning ends, as the model selection page also sets out.

Choosing what the search optimises

The search optimises whatever metric it is given, so the metric has to match the use. For abstract screening a missed relevant study costs more than an extra abstract to read, and ECD20 asks for evidence that automated screening misses no more relevant records than standard human screening would. Accuracy suits this poorly, because when relevant records are rare a model that excludes everything scores well. A better objective sets a minimum sensitivity and maximises specificity above it, a form of constrained optimisation that Feurer and Hutter describe. The Confusion Matrix and False Negative Rate pages in this glossary set out the measures.

The decision threshold is tuned too. In its advice on customising a large language model for semi-automated or automated screening, ECD20 describes the model rating each record's likelihood of inclusion, with a fixed cut-off turning the rating into a decision, and says both the scale and the cut-off need tuning and validation using calibration measures. When AI only supports human screeners, ECD20 says its scores should not be turned into a fixed exclusion cut-off. For structured data in primary evidence generation, ECD20 accepts non-generative machine learning models once validated and favours low-complexity models where possible.

Worked example tuning an abstract classifier

All numbers in this example are illustrative. A review team tunes a penalised logistic regression classifier to act as second screener in a semi-automated workflow, where ECD20 requires a human to adjudicate every disagreement. Two hyperparameters are tuned, the penalty strength and the weight given to relevant records, with a budget of 20 fits.

1. Chance of landing near the best. The team uses random search. A 5 by 4 grid would try only 5 distinct penalty values, while 20 random draws try 20. Bergstra and Bengio give the probability that at least one of TT random trials falls in a target region as

P=1−(1−vV)TP = 1 - \left(1 - \frac{v}{V}\right)^{T}

where PP is the probability of at least one hit, vv is the volume of the target region, VV is the volume of the whole search space and TT is the number of trials. For the best 5% of the space, v/Vv/V = 0.05. With TT = 20, (1−0.05)20=0.3585(1 - 0.05)^{20} = 0.3585 and PP = 1 − 0.3585 = 0.6415. With TT = 60, (1−0.05)60=0.0461(1 - 0.05)^{60} = 0.0461 and PP = 1 − 0.0461 = 0.9539.

2. Splitting the data. The team holds 3,000 abstracts labelled in earlier reviews on the topic. It uses 2,000 for training, 500 for validation during the search and 500 as a test set, the last two each holding 50 relevant and 450 irrelevant abstracts.

3. Choosing the winner. The pre-specified rule keeps configurations with validation sensitivity of at least 0.95 and picks the one with the highest specificity. The winner includes 48 of 50 relevant abstracts, a sensitivity of 48 / 50 = 0.96, and correctly excludes 405 of 450 irrelevant ones, a specificity of 405 / 450 = 0.90.

4. Testing once. On the test set it includes 46 of 50 relevant abstracts, a sensitivity of 46 / 50 = 0.92 and a false negative rate of 4 / 50 = 0.08. It correctly excludes 396 of 450 irrelevant abstracts, a specificity of 396 / 450 = 0.88, so it includes 450 − 396 = 54 irrelevant ones and flags 46 + 54 = 100 of 500 records, a share of 100 / 500 = 0.20.

5. Interpretation. Sensitivity fell by 0.96 − 0.92 = 0.04, two relevant abstracts. Part of the fall is the optimism of picking the best of 20 validation scores and part is chance, since each relevant abstract moves sensitivity by 1 / 50 = 0.02. The 0.92 is the figure to report, and it falls short of the 0.95 aimed for, so the classifier needs comparison with the human false negative rate before any wider role. ECD20 also asks for the false negative rate to be reported with a measure of uncertainty and suggests giving the absolute number of misses beside it, here 4 of 50. A Wilson 95% interval for the test sensitivity of 46 / 50 runs from 0.81 to 0.97 and still includes 0.95, so 50 relevant abstracts are too few to settle whether the target was missed.

Tuning beside fine-tuning, customisation and calibration

NICE ECD20 (2026) separates three ideas. Model Training builds a model from data, tuning adjusts a model that already exists, and LLM Customisation gets better output from a language model while leaving the model itself unchanged. Customisation still involves settings, since ECD20 notes that tools reached through an Application Programming Interface are generally customised by configuring hyperparameters and other settings, and it asks for prompt templates to be optimised on held-out development data.

Health economists meet a similar search in calibration, where natural history parameters of a health economic model are adjusted until its outputs match observed incidence or mortality. The search methods overlap, but calibration seeks fit to known data and hyperparameter optimisation seeks prediction for new data.

Reporting and reproducibility

Feurer and Hutter argue that automated search is more reproducible than manual tuning. ECD20 lists hyperparameters among the factors that may influence reproducibility, and notes that models with a random element, such as random forests, give repeatable results once their random seeds are fixed. TRIPOD+AI asks authors to describe all model building steps including hyperparameter tuning, and to give the number of participants and outcome events used for tuning. A report therefore gives the search space, strategy, budget, objective, data used at each step and seeds.

Limitations and common misreadings

The best validation score is not the expected performance, and only a separate test or a nested procedure estimates that. Tuning cannot make up for training data that leave out some study types, and ECD20 warns that screening models may perform worse on non-randomised studies, non-English abstracts or rare diseases. Because the hyperparameters that matter differ between datasets, settings tuned on one review topic may not carry over, and ECD20 advises considering re-validation when models, prompts or datasets change.

Sources

  • Bergstra J, Bengio Y. Random search for hyper-parameter optimization. Journal of Machine Learning Research. 2012;13:281-305. https://www.jmlr.org/papers/v13/bergstra12a.html
  • Collins GS, Moons KGM, Dhiman P, Riley RD, Beam AL, Van Calster B, et al. TRIPOD+AI statement: updated guidance for reporting clinical prediction models that use regression or machine learning methods. BMJ. 2024;385:e078378. https://pmc.ncbi.nlm.nih.gov/articles/PMC11019967/
  • Feurer M, Hutter F. Hyperparameter optimization. In: Hutter F, Kotthoff L, Vanschoren J, editors. Automated Machine Learning: Methods, Systems, Challenges. Cham: Springer; 2019. p. 3-33. https://doi.org/10.1007/978-3-030-05318-5_1
  • Li L, Jamieson K, DeSalvo G, Rostamizadeh A, Talwalkar A. Hyperband: a novel bandit-based approach to hyperparameter optimization. Journal of Machine Learning Research. 2018;18(185):1-52. https://www.jmlr.org/papers/v18/16-558.html
  • National Institute for Health and Care Excellence. AI methods for evidence framework (ECD20). NICE; published 9 November 2026. Introduction, principles, primary evidence generation and evidence synthesis chapters, and Appendix A glossary. https://www.nice.org.uk/corporate/ecd20
  • Probst P, Boulesteix AL, Bischl B. Tunability: importance of hyperparameters of machine learning algorithms. Journal of Machine Learning Research. 2019;20(53):1-32. https://www.jmlr.org/papers/v20/18-444.html
  • Varma S, Simon R. Bias in error estimation when using cross-validation for model selection. BMC Bioinformatics. 2006;7:91. https://doi.org/10.1186/1471-2105-7-91
  • Wilson EB. Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association. 1927;22(158):209-212. https://doi.org/10.1080/01621459.1927.10502953

Frequently Asked Questions (6)

  • What is Hyperparameter Optimisation?

    Hyperparameter optimisation is the search for machine learning model settings, such as those of a screening classifier, that perform best on held-out data.

    Source: Feurer and Hutter 2019

  • How is hyperparameter optimisation carried out, and how does random search compare with grid search?

    Hyperparameter optimisation fits the same learning algorithm many times with different settings, scores each fit on validation data held out from training and keeps the setting with the best score. Bergstra and Bengio describe this as an outer optimisation wrapped around the inner fitting of model parameters. Grid search tries every combination of preset values, while random search draws configurations at random. Because only a few hyperparameters matter on most datasets, and different ones on different datasets, they found that random search matched or beat grid search for neural networks in a small fraction of the computing time.

    Source: Bergstra & Bengio 2012

  • Why is the best validation score found by hyperparameter optimisation an optimistic estimate of model performance?

    The winning configuration is chosen because its validation score is the highest of many noisy scores, so part of its lead is luck. Varma and Simon tuned two classifiers by cross-validation on simulated data in which the two classes did not differ at all. The tuned error estimate fell below 30% on 18.5% of datasets for one classifier and 38% for the other, yet both did no better than chance on independent test data. A nested procedure, which repeats the tuning inside each outer fold, gave an estimate very close to the independent test result.

    Source: Varma & Simon 2006

  • What does NICE ECD20 expect of the data used for hyperparameter optimisation in AI evidence work?

    NICE ECD20 (2026) requires the data used to select, train, optimise, customise and validate an AI model to be independent of one another. It names holdout and cross-validation as ways to draw such samples from one population, so a review team either splits its labelled records three ways or uses nested cross-validation when data are scarce. The framework lists hyperparameters among the factors that may affect reproducibility and notes that random forests give repeatable results once random seeds are fixed. It also advises considering re-validation when models, prompts or datasets change.

    Source: NICE ECD20 (2026)

  • What should hyperparameter optimisation aim for when tuning a classifier that screens abstracts for a systematic review?

    The search improves whatever metric it is given, so the metric has to reflect the cost of screening errors. A missed relevant study does more harm than an extra abstract for a reviewer to read, and NICE ECD20 asks for evidence that automated screening misses no more relevant records than standard human screening. Accuracy is a poor objective, because relevant records are rare and a model that excludes almost everything scores well. A better rule sets a minimum sensitivity and picks the configuration with the highest specificity above it, with the decision threshold tuned and validated as well.

    Source: NICE ECD20 (2026)

  • How does hyperparameter optimisation differ from fine-tuning a large language model and from calibrating a health economic model?

    NICE ECD20 (2026) treats hyperparameter optimisation as tuning of traditional machine learning models, such as screening classifiers, and keeps it apart from fine-tuning, which adapts a large language model. Both differ from LLM customisation, which seeks better output while leaving the model itself unchanged. Health economists meet a similar search in model calibration, where natural history parameters are adjusted until the outputs of a health economic model match observed incidence or mortality. The search methods overlap, but calibration seeks fit to known data, while hyperparameter optimisation seeks good prediction for new data.

    Source: NICE ECD20 (2026)

Trust Record

Verified by Dr Darrin Baines

British health economist

Professional identity: darrinbaines.org

Verification date: 10 Nov 2026

Content version: 1.0.0

Canonical Identity

Term code
HS-HP-DH-092

Stable URI · Machine-readable · Resolvable · CC BY 4.0

This article is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).

Author: Dr Darrin Baines · Publisher: Intelligent Parameters Ltd · Identifier: https://healtheconomics.wiki/concept/hyperparameter-optimisation