Problem :
I want to use the glmnet package on a dataset. I am trying to use cv.glmnet() to get the lambda value for the glmnet().
Please find below the dataset and error message:
> head(t2)
X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 X11 X12
1 1 1 1.7661266 45 2 0.80298213 9120 13 0 6 1 2
2 2 0 1.9571510 40 0 0.12187620 2600 4 0 0 1 1
3 3 0 1.6581801 38 1 0.08511338 3042 2 1 0 1 0
4 4 0 1.2338098 30 0 0.03604968 3300 5 0 0 1 0
5 5 0 1.9072394 49 1 0.02492570 63588 7 0 1 1 0
6 6 0 1.2131787 74 0 0.37560697 3500 3 0 1 1 1
> cv1 <- cv.glmnet(as.matrix(t2[,-c(1,2,7,12)]), t2[,2], family="binomial")
Error in as.matrix(cbind2(1, newx) %*% nbeta) :
error in evaluating the argument 'x' in selecting a method for function 'as.matrix': Error in t(.Call(Csparse_dense_crossprod, y, t(x))) :
error in evaluating the argument 'x' in selecting a method for function 't': Error: invalid class 'NA' to dup_mMatrix_as_dgeMatrix
> cv1 <- cv.glmnet(as.matrix(t2[,-c(1,2,7,12)]), t2[,2], family="multinomial")
Error in t(.Call(Csparse_dense_crossprod, y, t(x))) :
error in evaluating the argument 'x' in selecting a method for function 't': Error: invalid class 'NA' to dup_mMatrix_as_dgeMatrix
Any suggestions regarding the solution?