Make sure sparse matrices can be used with predict()#1167
Merged
Conversation
8 tasks
Member
Author
|
ended up adding sparse tibble support in this PR as well since we were almost there |
EmilHvitfeldt
commented
Sep 4, 2024
Comment on lines
+447
to
+449
| if (inherits(x, "model_fit")) { | ||
| x <- x$spec | ||
| } |
Member
Author
There was a problem hiding this comment.
allow_sparse() was assumed to only work on model_spec. This change makes it so it also works on model_fit objects
Contributor
There was a problem hiding this comment.
thanks for the additional context!
simonpcouch
approved these changes
Sep 5, 2024
Comment on lines
+447
to
+449
| if (inherits(x, "model_fit")) { | ||
| x <- x$spec | ||
| } |
Contributor
There was a problem hiding this comment.
thanks for the additional context!
Co-authored-by: Simon P. Couch <simonpatrickcouch@gmail.com>
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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