Regression

Predict a number: set-up, metrics, residual plots and algorithms.

Regression predicts a number. The target column is numeric, for example a price, a delivery time or a monthly spend.

When to use it

Use regression when the answer is a quantity on a continuous scale. If the answer is a label such as "churn" or "no churn", use Classification. If the numbers are a series in time and you want future values, use Time series forecasting.

Set it up

Create the pipeline

In your project, open Pipelines, select New and then New pipeline. Type a Name, set Task to Regression, pick the Dataset and the Target column, and select Create pipeline. The dataset list shows only data sources added as CSV files.

Add preprocessing

Add imputation, encoding and scaling steps as needed. See Preprocessing steps. Scaling matters for distance-based and margin-based algorithms; tree-based algorithms do not need it.

Choose algorithms and validation

Open the Models part of the pipeline editor and tick the algorithms to compare. In the Cross-validation card set CV folds (2 to 20, default 10) and Fold strategy: K-fold (the default) or Group k-fold with a Group column. See Cross-validation and group folds. Select Train N models.

As in classification, the engine holds out 30 percent of the rows by default and runs cross-validation on the other 70 percent.

Metrics

The leaderboard shows MAE, MSE, RMSE, R2, RMSLE and MAPE. R2 is higher-is-better; the other five are errors, where lower is better. mlflow knows the direction of each metric, so the Best model card and the default sort pick the right winner. See Metrics reference.

Plots

Open a model with View details.

TabPlots
DiagnosticsPredicted vs. actual, Residuals vs. predicted, Residuals distribution
ExplainabilityFeature importance, Permutation importance
CurvesLearning curve

Read the residual plots first. Residuals are the differences between the actual and predicted values. They should scatter around zero with no pattern. A curve or a funnel shape means the model is missing structure or its error grows with the size of the value.

Algorithms

The catalog includes plain and regularized linear models (Linear Regression, Lasso, Ridge, Elastic Net and others), robust linear models (Huber, Random Sample Consensus, TheilSen), kernel methods, nearest neighbours, trees, forests, boosting, a neural network and a dummy baseline. See the Algorithms catalog. The run also trains a Baseline reference model that is never ranked.

Skewed targets

Prices, durations and counts are often skewed: many small values and a few very large ones. A few large values can dominate squared-error metrics such as RMSE. Options in mlflow:

  • Compare MAE with RMSE. If RMSE is much larger than MAE, a few large errors drive the score.
  • Add a Log Transform or Power Transformer step on the feature columns that are skewed.
  • Use RMSLE when relative errors matter more than absolute ones. It works on log values, so it penalizes a miss of 10 on a value of 20 more than a miss of 10 on a value of 2,000.

MAPE ignores rows whose actual value is 0, because a percentage of zero is undefined. If your target contains many zeros, prefer MAE or RMSE.

Next steps

Learn the theory

Lessons on learning.mlflow.es that explain the ideas behind this page.

Updated 2026-11-22