Regression
Regression is a supervised learning task where a model predicts a continuous number, such as a house price, a temperature, or someone's age.
Data & AI
Unlike classification, which predicts categories, regression predicts a value along a range. The model learns how the input features relate to the numeric output and uses that relationship for new inputs.
Predicting tomorrow's sales from this week's ad spend, or a car's fuel efficiency from its weight and engine size, are classic regression problems. The simplest and most common method is linear regression.
Examples
Python
from sklearn.linear_model import LinearRegression
model = LinearRegression().fit([[1], [2], [3]], [2, 4, 6])
print(model.predict([[10]]))Output:
[20.]