Regression
الانحدار
Definition
A supervised learning task in which the model predicts a continuous numeric value, such as a price or a temperature.
Definition
Regression is a supervised learning task in which a model predicts a continuous numerical output from input features.
Practical examples
import numpy as np
from sklearn.linear_model import LinearRegression
X = np.array([[1], [2], [3], [4]])
y = np.array([3, 5, 7, 9]) # y = 2x + 1
m = LinearRegression().fit(X, y)
print(round(m.coef_[0], 2), round(m.intercept_, 2), m.predict([[5]]).round(2))Expected output
2.0 1.0 [11.]
Mathematical equations
\hat y = \beta_0 + \sum_{j=1}^{p} \beta_j x_j, \qquad \mathrm{MSE} = \frac{1}{n}\sum_{i=1}^{n} (y_i - \hat y_i)^2Scientific sources
References and scientific sources
-
BookThe Elements of Statistical Learning (2nd ed.) A statistical reference on machine learning, freely available from the authors' website.
-
BookPattern Recognition and Machine Learning A classic reference on probabilistic machine learning.
