Linear Regression Notes
Linear Regression Notes
Linear regression is one of the most fundamental and widely used algorithms in
machine learning. It is a supervised learning technique used for predicting a
continuous target variable based on one or more input features.
𝑚
=
𝑏
+
y=mx+b
y is the predicted value (output)
For multiple linear regression, where there are multiple input features, the model
generalizes to:
𝑤
=
𝑥
1
𝑤
+
𝑥
2
2
+
⋯
𝑤
+
𝑛
𝑥
𝑛
𝑏
+
y=w
1
x
1
+w
2
x
2
+⋯+w
n
x
n
+b
𝑤
Here,
𝑤
,
2
,
…
𝑤
,
𝑛
w
1
,w
2
,…,w
n
How It Works
The goal of linear regression is to find the best-fitting line through the data
that minimizes the difference between the predicted values and the actual values.
This difference is measured using a loss function, typically the Mean Squared Error
(MSE):
MSE
=
𝑛
1
𝑖
∑
𝑛
1
𝑦
(
𝑦
−
𝑖
^
)
2
MSE=
n
1
i=1
∑
n
(y
i
−
y
^
)
2
where:
𝑦
𝑖
y
i
𝑖
^
y
^
𝑛
n is the number of data points
Applications
Linear regression is used in various domains including:
Economics (predicting costs, revenues)
Disadvantages
Poor performance with non-linear relationships
Sensitive to outliers
Conclusion
Linear regression serves as a foundational technique in machine learning and
statistics. While it may not always produce the most powerful predictions in
complex scenarios, it offers clarity, efficiency, and a solid baseline for
regression tasks. Mastering linear regression is a crucial step toward
understanding more advanced machine learning models.