I have created a glmnet
model to use it with new data for predictions.
ypred <- predict(fit, newx = pred.dat, type = "class")
but it returns following error message:
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: Cholmod error 'X and/or Y have wrong dimensions' at file ../MatrixOps/cholmod_sdmult.c, line 90
The problem seems to sit within the new data set, but because I don't know what the error message means, so can't really fix it. Could somebody help me to point out what the issue might be? The new data set has been treated with the same script as the data used to create the model. The new data set is just much larger
dim(pred.dat)
[1] 295919 255
so I can not simply scroll through it to identify the issue.