Improve a model
Tune hyperparameters, blend or stack candidates, and read the model candidate page.
A first run tells you which algorithms suit your data. The next step is to improve the best ones. mlflow gives you three ways, and all of them work on the candidates of a finished run:
- Tune searches for better hyperparameters of one algorithm.
- Blend or stack combines several candidates into one model.
- Bag or boost wraps one algorithm in an ensemble.
Each action trains a new candidate inside the same run. The new candidate appears in the leaderboard next to the others, labelled with how it was made (tuned, blended, stacked, ensembled). Nothing is replaced, so you can always compare the result with where you started.
These actions need the Editor role in the project and a run that has finished successfully. Each one is a training job, so it counts toward your plan's usage like any other.
The model candidate page
Select View details on a candidate in the leaderboard. The page shows the candidate's rank and its Primary metric, with a note on whether lower or higher is better, and the vs Best difference. The tabs are:
| Tab | What it shows |
|---|---|
| Overview | All the metrics, the Run context (task, target, dataset, plan, train size, CV folds, seed) and your Notes (Markdown, saved with the candidate) |
| Pipeline | The steps of the fitted pipeline as a diagram, colour-coded by kind. Select a step to see its parameters |
| Hyperparameters | The values the algorithm used |
| Plots | Diagnostics and explainability charts for the task. See Read a run |
| Predict | Try the model: the input is filled with a real row, and Run prediction shows the prediction, with class probabilities for classification |
| Validation | Cross-validation per fold and Cohort metrics: slice the results by a column to see where the model is weaker |
| Artifact | The stored model file and its SHA-256 checksum |
For a candidate made by tuning, blending or stacking, the page also shows what it was built from. A blend or stack shows its Blend contribution or Stack contribution: for example, Beat best base by a number, or Trails best base by a number. If an ensemble does not beat its best member, you gain complexity for nothing.
From this page you can also use Compare (pick another candidate for a side-by-side view), Download pipeline and Export model card, which saves a Markdown summary with the metrics, parameters and pipeline structure.
For the plots on this page, the lesson on feature importance explains how to read the explainability charts.
Tune
Tuning tries different hyperparameter values for one algorithm and keeps the best. There are two ways to tune.
Tune after a run
Open a candidate
Open the candidate page of the algorithm you want to improve.
Select Tune
Select Tune. The dialog Tune model name opens. It runs a random search over the algorithm's own hyperparameter space, with the same cross-validation settings as the run.
Set the search
- Search iterations: how many combinations to try. More iterations can find better values but take longer. The default is 10 and the range is 1 to 200.
- Optimize metric: the metric that scores each combination during the search. Leave it on the engine default, or pick, for example, Recall if missing a positive case is costly.
Select Start tuning.
Watch it
The event log opens on the right so you can see the search. When it finishes, a new tuned candidate appears in the run.
Tune during training
In Pipeline Studio, each algorithm card in the Models part of the pipeline editor has a Tuning setting, so the search happens as part of the run:
| Method | What it does |
|---|---|
| None | Uses the algorithm's default or manual values |
| Random search | Tries a set number of random combinations (Iterations) |
| Grid search | Tries every combination of the values to search. It is refused when there would be more than 500 combinations, and it tells you so |
| Bayesian | Uses the scores so far to choose the next combination. Set Trials (default 20, range 1 to 200) and Timeout (s) (default 600, range 10 to 3600). When the timeout runs out, the trial in progress finishes and the best result so far is kept |
Bayesian search needs an optional component on the server. If it is missing, the option says so. Parameters you set by hand (Manual mode) stay fixed and are not searched. Tuning is available for classification and regression.
The candidate page of a tuned model has a Tuning history chart: the cross-validation score of every trial and the best score so far, plus the Best hyperparameters. Check it: if the best score was found in the last few trials, a longer search may still improve the result. A summary line says how many trials ran, for example Bayesian search (optuna): 20 of 20 trials ran, and whether the timeout stopped it.
Tune after you have chosen the algorithm, not before. Comparing many algorithms with default values is fast, and tuning only the top one or two is cheaper than tuning all of them. Read the lesson on search strategies to decide between random, grid and Bayesian search.
Blend and stack
A blend or a stack combines several trained candidates into one model. The idea is that models make different mistakes, so a combination can be better than any single one.
- Blend: the models vote, or average their predictions. For classification you choose Soft voting (average the predicted probabilities), Hard voting (majority class) or Auto, which uses soft voting when every model can give probabilities. For regression, the predictions are averaged. Soft voting is blocked when a selected model cannot give probabilities, and the dialog names it.
- Stack: a second model, the Meta-learner, learns from the cross-validated predictions of the selected models how much to trust each one. A linear meta-learner is usually a good default; the dialog hints that tree-based ones can overfit on small datasets.
Select candidates
On the Leaderboard tab, select the check boxes of two to ten candidates. A bar appears with the number selected and the actions Blend, Stack and Combine. Select Clear to start over.
Choose blend or stack
Select Blend or Stack. Choose the Method or the Meta-learner, then Start blend or Start stack.
Read the result
A new blended or stacked candidate trains in the run. Open it and read its contribution against the best member.
Rules to know:
- Blend and stack are available for classification and regression runs.
- A candidate must have a stored model to be a source. The Baseline row and failed candidates cannot be selected, and blends and stacks cannot be nested inside each other.
- You need at least 2 and at most 10 candidates.
Read the lesson on blending and stacking for the theory.
Bagging and boosting one model
On a candidate page, select Ensemble. The dialog Ensemble wraps the algorithm in an ensemble made of many copies of itself:
- Bagging trains the copies on random samples of the rows and averages them. It reduces variance, so it helps an algorithm that overfits.
- Boosting trains the copies one after another, each one focusing on the mistakes of the previous one. It reduces bias, so it helps an algorithm that is too simple.
Choose the Method, set the number of base estimators and select Start bagging or Start boosting. The result is a new ensembled candidate. See the lesson on bagging.
Model card
For the best model of a run, Model card (in the ... menu of the run) opens a page with the headline metrics and the diagnostic plots, organised by Diagnostics, Explainability, Curves and Raw. It is useful to share with someone who was not in the run.
The model card needs a saved pipeline. If the run has not been registered or promoted yet, the page says This run hasn't been promoted yet and offers Promote run. Promoting saves the fitted model in the workspace's registry; see Register and manage models.
Download the model
- Download pipeline on a candidate page saves the fitted model as a file.
- Download best model in the run's ... menu does the same for the best candidate.
- Deploy best model opens a dialog with more export choices (including a deployment kit) and the option to deploy on this server. See Deploy and test a model.
Next steps
Learn the theory
Lessons on learning.mlflow.es that explain the ideas behind this page.
Updated 2026-11-22