Loading…
Glossary term
Predicting a continuous numeric value, such as a price.
Regression predicts a number: a house price, tomorrow's temperature, a delivery time. The simplest form, linear regression, fits a straight line through the data by minimizing the squared errors. More flexible models capture curves and interactions.
Linear regression
from sklearn.linear_model import LinearRegression
model = LinearRegression().fit([[1], [2], [3]], [2, 4, 6])
print(model.predict([[4]])) # [8.]It is the standard tool for forecasting and estimating quantities.