I am trying to train any of the penalised models like lasso, but I'm constantly getting this error." Warning: Setting row names on a tibble is deprecated.Warning: model fit failed for Fold01.Rep1: alpha=0.10, lambda=0.04654 Error in (function (x, y, family = c("gaussian", "binomial", "poisson", : "
Here is my code:
new_df$bcpm07c <- as.factor(new_df$bcpm07c )
outcomeName <- "bcpm07c"
predictorsNames <- names(new_df)[names(new_df)!= outcomeName]
ctrl <- trainControl(method="repeatedcv",number = 10,repeats =3 )
fit.lass <- train(Train[,predictorsNames], Train$bcpm07c, family= "binomial", alpha = 1, method='glmnet', trControl=ctrl)
I have tried using changing different ways of splitting the data into x and y but none of them has helped. Checked online but the code seems correct. I checked the dim and it 6048,148 for x_train and (6048,1) for y_train. I don't know where the error is coming from.