Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error to predict when using a model generated with --olm #14

Open
lucmarchandhsj opened this issue May 9, 2024 · 1 comment
Open

Error to predict when using a model generated with --olm #14

lucmarchandhsj opened this issue May 9, 2024 · 1 comment

Comments

@lucmarchandhsj
Copy link

Hi. I can generate model using train and evaluate using predict without problem with standard flags but if I use --olm in the train fonction, the predict gives the following error:

Error in if (ncol(newx) != p) stop(paste0("The number of variables in newx must be ", :
argument is of length zero
Calls: predict -> predict.glmnet

Any clue of what is wrong?

@lucmarchandhsj
Copy link
Author

I ended up commenting out this line and now it's working:

model <- model[which(names(model) %in% c('beta', 'lambda', 'a0', 'offset'))]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant