Simple Linear Regression
Linear regression is a machine learning algorithm it is for linear or sort of linear data it is a line y=mx+b and L = Σ(yi-yi_hat)2
But Simple linear regression can be applied on only 2d Data
It means L is function of m and b and we have to calculate value of m and b
There are two ways in which we can calculate m and b
1. Closed-form Solution(OLS)
2. Non-Closed-form Solution(Gradient Descent)
Today, we are going to study OLS(Ordinary Least Square) method
Firstly I will show you direct formula to calculate m and b
m=Σ(xi-X_MEAN)(yi-Y_MEAN)/Σ(xi-X_MEAN)2
b=y_mean-m*x_mean
Derivation
We have to find those m and b value who can minimize loss
so differentiation
dl/db=y_mean-(m*x_mean)
dl/dm=Σ(xi-X_MEAN)(yi-Y_MEAN)/Σ(xi-X_MEAN)2
🖂 EMAIL-->aarushdixit73@gmail.com
Comments
Post a Comment