Mathematics of Ridge regression
Let's get started with "What do we have to do?"
In such case of simple linear regression(OLS).b=y_mean-m*x_mean and m=∑(Xi-X_mean)(yi-y_mean)/∑(Xi-X_mean)2
In such a case of ridge we derive everything again but we don't derive b because in ridge we reduce m not b will be the same as well.
1. Choose a loss function.In this case I choose L=𝜮(yi-p)2
2. Calculate dL/dm=∑(Xi-X_mean)(yi-y_mean)/∑(Xi-X_mean)2+λ to minimize loss
Then m=∑(Xi-X_mean)(yi-y_mean)/∑(Xi-X_mean)2+λ
And in this case, you clearly see if we increase λ m decrease but it affects b also but not that much
And λ is a hyperparameter in whole Regularization
Comments
Post a Comment