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

Singular design matrix: training fails on literally constant data #266

Open
dsweber2 opened this issue Nov 3, 2023 · 1 comment
Open

Comments

@dsweber2
Copy link
Contributor

dsweber2 commented Nov 3, 2023

This is possibly more a problem with parsnip, but not being able to predict a literally flat value is not great.

@dajmcdon
Copy link
Contributor

dajmcdon commented Dec 16, 2023

Really, this may or may not be a problem depending on the engine. With lm(), when X has more than 1 constant column, the associated coefficients will be NA but prediction is possible. glmnet() silently ignores them and estimates their coefficients to be 0.

On the other hand, if y = constant, then lm() will run, but glmnet() errors out.

This needs a reprex showing where / when it fails.

Additionally, erroring out here may well be desirable, depending on the message. The goal of epipredict is not to "always give predictions". If there's a problem with the data, the user should be told.

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

2 participants