it just reports:
Cholmod error 'X and/or Y have wrong dimensions' at file ../MatrixOps/cholmod_sdmult.c, line 90.
i don't know why.
x.m <- data.matrix(train[,c(1:43)])
x.m [is.na(x.m)] <- 0
y.m <- train$NPL
cv.m <-data.matrix(cv)
set.seed(356)
cvfit.m.lasso = cv.glmnet(x.m, y.m,
family = "binomial",
alpha = 1,
type.measure = "class")
par(mfrow=c(1,2))
plot(cvfit.m.lasso, main = "Lasso")
coef(cvfit.m.lasso, s = "lambda.min")
predTrain.M = predict(cvfit.m.lasso, newx=cv.m, type="class")
table(cv$NPL, predTrain.M)
It is fixed for me now. It was because I forgot to remove my Target variable from the test data , and that is why i was getting this error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With