-
Notifications
You must be signed in to change notification settings - Fork 90
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
Make sure sparse matrices can be used with predict()
#1167
Conversation
ended up adding sparse tibble support in this PR as well since we were almost there |
if (inherits(x, "model_fit")) { | ||
x <- x$spec | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
allow_sparse()
was assumed to only work on model_spec
. This change makes it so it also works on model_fit
objects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the additional context!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stellar. Nice work!
if (inherits(x, "model_fit")) { | ||
x <- x$spec | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the additional context!
Co-authored-by: Simon P. Couch <[email protected]>
This pull request has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
Ref: #1125
Predicting with a sparse matrix already works, as long as the engine supports it. but is now tested with this PR.
Waiting for #1165 to be merged so I can use the helper function defined there to give better error message when sparse data is passed to model that doesn't support it