Prediction using ridge regression



Hi All,

I want to use ridge regression for BigMart sales. I am able to build a model using lm.ridge.
However I am unable to predict.


Hi Surya,

Here is the theory for Ridge Regression -

Example R code:

Important thing to note is while you use use other methods (non-Ridge) you can use the predict function, while you use ridge you will need coefficients.

Sample code when you have 4 coefficients and are using Ridge:

pred.ridge <- coef(lm.ridge)[1] + coef(lm.ridge)[2]*test[,1] + coef(lm.ridge)[3]*test[,2] + coef(lm.ridge)[4]*test[,4]

Hope this helps.



Thank you Taposh.

I have another query: I have seen using Scale to predict. What is that exactly?


Hi Surya,

Yes Scales were used in the past.

There have been several papers using scale to predict some outcomes. This was a trend in medical domain.
But, these were sort of older methods, I am curious to know where you have seen it recently.




Hi Taposh,

I got this from below website:

It would be great if you can explain how to interpret the results of the model. Choosing best lambda etc…