# Prediction using ridge regression

#1

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.

#2

Hi Surya,

Here is the theory for Ridge Regression -
http://web.as.uky.edu/statistics/users/pbreheny/764-F11/notes/9-1.pdf

Example R code:
http://people.stat.sfu.ca/~cao/Teaching/852/Ridge.R

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.

T

#3

Thank you Taposh.

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

#4

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.

Taposh

#5

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â€¦