Skip to content

Learn / A visual introduction

Hyperparameter optimization,
explained.

Hyperparameter optimization (HPO) searches for settings that improve a metric you choose, such as accuracy.

Start with a recipe. Then explore how grid, random, and Bayesian search choose what to try next.

The idea, in one loop
  1. 01
    Choose settings

    A combination worth testing

  2. 02
    Run your experiment

    The same task, different inputs

  3. 03
    Measure the result

    Compare using your metric

Use what you learn. Try the next settings.

02 / From recipes to software

Models have settings, too.

In machine learning, there is a useful distinction between what a model learns from data and the choices that control how it learns.

The model learnsParameters
The values fitted from training data, such as a neural network’s weights.
You configureHyperparameters
Choices such as learning rate, maximum tree depth, or the number of trees. A search can help select them.

Our software example: a random forest classifier

We’ll vary maximum tree depth and minimum samples per leaf, then compare validation accuracy. Different settings can change how well the model generalizes; tuning does not guarantee an improvement.

The same search pattern works beyond ML: trading strategy settings, simulation inputs, and other programs with settings and a measurable result. This is often called parameter optimization.

03 / Choose what to try next

Three ways to explore the same space.

The task and allowed settings stay the same. The search method changes how the next combination is chosen. Switch methods, then step through the trials.

Same space. Different choices.12 / 12 trials
Grid search: tree depth and minimum samples per leaf An illustrative sequence of twelve trials. Each numbered point is one tested combination. Darker background shading represents higher fictional validation accuracy. The background is shown for explanation; a real optimizer only observes scores at the settings it tests.

Trial 12 · depth 16 · leaf size 12

Background: fictional validation accuracy, low to high

Grid search

Cover a fixed set of combinations.

Choose a list of values for each setting, then test every combination in that grid. Previous scores do not change the order.

Here: 4 depth values × 3 leaf sizes = 12 trials.

When it helps
Useful when the space is small and you want to cover specific values.
Keep in mind
The number of combinations grows quickly as you add settings.

Keep covering the chosen combinations.

Illustration, not a benchmark. Scores and trial sequences are fictional; no optimizer runs in this demo. Real optimizers only see the results of trials they have run.

04 / Read the results

Keep the settings behind every score.

Here are the top three trials from the illustrative Bayesian sequence above. Each result stays connected to the exact combination that produced it.

Example experiment

Random forest classifier

Illustrative data
Depth range
2–16
Minimum leaf size
1–12 samples
Trial budget
12 runs
Objective: maximize validation accuracy
TrialMax. depthMin. leaf sizeValidation accuracy
#010Best found10392.5%
#00611491.2%
#0079291.2%

Fictional scores for illustration. This is a comparison of tested settings, not a claim about model performance.

Search space
The values each setting is allowed to take.
Trial
One run with one combination of settings.
Objective
The metric to improve, and whether to maximize or minimize it.
Best found
The strongest measured result among the trials you ran.

05 / Check what holds up

A promising score is a starting point.

Searching more settings gives you more chances to find a high score—including a lucky one. Check that the result holds up beyond the data used to choose it.

  1. Compare against a baseline.

    Evaluate the starting configuration and new trials using the same metric and validation procedure.

  2. Keep final test data separate.

    Use validation data to select settings. Evaluate the chosen model on untouched test data; repeatedly tuning against the test set makes it part of the search.

  3. Check variation between runs.

    When results depend on randomness, repeat promising configurations with different seeds. Look for a reliable improvement, not just the highest single score.

A few practical questions

How many trials do I need?

Start with a budget you can afford and compare against a baseline. The useful trial count depends on the search space, run time, and how much scores vary. There is no universal number.

Will it find the best possible settings?

There is no general guarantee. A search finds the best result among the combinations it evaluates, using the metric and data you provide.

Does running in parallel change the search method?

The search method chooses settings. Parallel execution runs several trials at once. It can reduce elapsed time when enough compute is available; adaptive methods can use a completed result only after that trial finishes.

06 / Put it to work

Run your first parameter search.

HyperOptimizer brings search methods, parallel cloud execution, and results into one workflow. You define the experiment; we run the trials and collect their metrics and logs.

Bring your program

A Docker image with your code and dependencies.

Define the search

Settings, a metric, and a trial budget.

Compare the results

Every run, with its parameters and logs.

7-day Starter trial · payment details required