How it works
Regression is a machine learning task that predicts a numeric value from data. In a supervised model, each training example includes attributes, such as property features, and a known target value, such as the recorded price. The algorithm learns a relationship between these elements to estimate values for new cases.
Linear regression models a relationship as a weighted combination of attributes. There are also nonlinear methods, decision trees and other regression algorithms. The scikit-learn linear models page documents approaches for fitting relationships between variables; the appropriate method depends on the data and the task.
A model can overfit the training examples, or fail to capture relevant patterns. To evaluate generalization, split training and evaluation data, compare predictions to known values and look at metrics such as mean absolute error or root mean squared error. A single metric does not explain all errors, so also examine individual cases and the distribution of residuals.
Practical example
A store wants to estimate weekly demand for a product. The team gathers historical data and attributes known before the week, such as calendar, promotional price and product characteristics. It trains a model to predict a numeric quantity and compares predictions against weeks held out from training.
If the model predicts fewer units than actual demand, there may be stockouts; if it predicts too many, the company may hold unnecessary inventory. The team analyzes the magnitude and direction of errors, checks whether performance changes across different seasons and compares the model to a simple baseline rule.
An estimate is not a guarantee. Changes in campaigns, competition or availability can alter demand. For that reason, the system needs to record when the forecast was made, what data was used and how the team will review the estimate when new information arrives.
What it's for
Regression is used to estimate prices, times, consumption, demand, volumes and other numeric quantities. In a product, it can support inventory planning or resource prioritization. In a technical application, it can predict load or task duration from observed characteristics.
Do not confuse a forecast with a causal explanation. If an attribute appears associated with a predicted value, that does not prove it caused the change. Also do not confuse regression with classification: the first estimates numbers, while the second chooses categories, although a problem can be formulated in different ways.
Before publishing forecasts, document the target variable, data source, evaluation period and known limitations. Check whether the data represents future use and monitor changes. An estimate is more useful when the person making the decision understands its uncertainty and knows how to act when error matters.