Data science

Regression

Regression predicts a continuous numerical outcome (house price, GDP growth) from input features.

Ask the Data science assistant1 min read · Updated September 9, 2026

Definition

Regression outputs a real number rather than a class — the target is ordered and infinite (in theory).

Metrics differ from classification: use R2R^2, MAE (Mean Absolute Error), or RMSE (Root Mean Squared Error) instead of accuracy.

Intuition

Regression finds the best-fit line (or hyperplane in higher dimensions) through your data in some loss sense.

The key question is whether the predicted values are meaningful across the full range of the target — extrapolating beyond training data is always risky.

Worked example

Predicting house price from size, location, and age: output might be $285,000 dollars.

Forecasting monthly sales from advertising spend and seasonality: output is a number of units.

The math

Linear regression minimizes MSE; more robust variants minimize MAE (ladder regression) or Huber loss (less sensitive to outliers).

Polynomial regression adds x2,x3x^2, x^3 terms to capture non-linear relationships while staying within the linear regression framework.

In practice

Used for forecasting, pricing models, risk assessment (where the output is a score), and any scenario where the target is continuous.

Validate regression with residual plots — patterns in residuals reveal missed non-linearity or heteroscedasticity.

More in Data science

Assembled from the ReLU.chat curated knowledge base. These explanations are concise on purpose; check the sources for anything important.