How to predict values for test dataset after building an lm.ridge model in R?

r
machine_learning
ridge_regression
regression

#1

Hi,

I was trying to learn and apply the ridge regression algorithm on my training dataset to predict values in the test dataset.

mod=lm.ridge(log_Hazard~ T2_V1+T1_V2+T2_V9+T2_V4+T2_V2+T1_V1+T2_V15+T2_V10+T2_V7+T1_V3+T1_V10+T2_V14+T1_V13+T2_V6+T1_V14,data=train,lambda=0.001)

but while predicting the values for the test dataset the way we normally do,

pred=predict(mod,test)

I am getting an error saying

Error in UseMethod(“predict”) :
no applicable method for ‘predict’ applied to an object of class “ridgelm”

What additional parameters do I need to specify for the same?

Thanks.