[R] predict for a cv.glmnet returns an error

asafw assafweinstein at gmail.com
Tue Nov 1 23:34:56 CET 2011


Hi there,

I am trying to use predict() with an object returned by cv.glmnet(), and get
the following error:
no applicable method for 'predict' applied to an object of class "cv.glmnet"

What's wrong?

my code:

x=matrix(rnorm(100*20),100,20)
y=rnorm(100)
cv.fit=cv.glmnet(x,y)
predict(cv.fit,newx=x[1:5,])
coef(cv.fit)

Thanks so much,

Asaf

--
View this message in context: http://r.789695.n4.nabble.com/predict-for-a-cv-glmnet-returns-an-error-tp3965744p3965744.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list