Regression
Regression is the supervised-learning task that predicts a continuous value —a number—, as opposed to classification, which predicts categories. From least-squares fitting to the MSE, MAE and R² metrics, regularized variants and the logistic-regression caveat.
In machine learning, regression is the supervised task of predicting a continuous value —a number— from one or more input variables. That sets it apart from classification, its sibling task, which predicts a category instead of a number: whether an email is spam, whether a tumor is benign or malignant. Forecasting a house price, tomorrow's temperature or a region's electricity demand are regression problems; labelling an image is classification.
Linear regression as the base case
The founding model is linear regression: fitting a straight line (or, with several inputs, a hyperplane) that runs through the cloud of points as well as possible. «As well as possible» is defined by minimizing the squared error —the sum of the squared vertical distances between each data point and the line. This criterion is the method of least squares. Its appeal is a closed-form solution and readable results: each coefficient tells you how much the output changes when an input rises by one unit.
How a regression model is measured
Because the output is a number, being right is not «yes or no» but how far the prediction lands from the true value. The usual metrics are the mean squared error (MSE), which averages the squared errors and punishes large misses heavily; its root, the RMSE, which returns the error to the variable's original units; the mean absolute error (MAE), which averages the errors in absolute value and is more robust to outliers; and the coefficient of determination (R²), which states what share of the output's variability the model explains, with 1 being a perfect fit.
Variants and the logistic-regression caveat
The family is broad: polynomial regression bends the line to fit non-linear relationships, and models such as decision trees, random forests or neural networks also tackle regression tasks. One common confusion is worth clearing up: logistic regression, despite its name, does not predict a free number but the probability of belonging to a class, and applying a threshold turns it into a category. In the machine-learning taxonomy it is therefore a classification method; it keeps the word «regression» because, internally, it fits a continuous function.
Overfitting and regularization
Like any model, regression can overfit: memorizing the noise in the training data rather than the signal, and failing on new data. This is the visible face of the bias-variance tradeoff. To hold it in check we use regularization, which penalizes large coefficients: Ridge regression shrinks them without zeroing them out, whereas Lasso can drive them exactly to zero and thus select variables. Both trade a little bias for less variance —the core idea gathered in texts such as «The Elements of Statistical Learning».
Pieces using this term
- From model to scanner: making an AI explanation falsifiable (2026-07-24)
- Nano Banana 2 Lite and Omni Flash: reading speed, price and release status (2026-07-24)
- Motorway measures its agent: tool selection rises from 87% to 98% (2026-07-24)
- Context for coding agents: what to document and how to test it (2026-07-23)
- Codex adjusts GPT-5.6 context: what changes for long sessions (2026-07-22)
- AgentFAIR uses AI agents to audit geospatial data (2026-07-22)
- Kimi K3 raises the bar for open-class models, but testing still matters (2026-07-21)
- AI found a critical OpenVM flaw, but human auditing closed the case (2026-07-21)
This article was produced with artificial intelligence under human editorial oversight.