Skip to content

Allow sparse tibbles in fit() and fit_xy()#1165

Merged
EmilHvitfeldt merged 6 commits intomainfrom
sparse-tibbles-fit
Sep 4, 2024
Merged

Allow sparse tibbles in fit() and fit_xy()#1165
EmilHvitfeldt merged 6 commits intomainfrom
sparse-tibbles-fit

Conversation

@EmilHvitfeldt
Copy link
Copy Markdown
Member

@EmilHvitfeldt EmilHvitfeldt commented Aug 29, 2024

Ref: #1125

This PR is in essence very similar to #1121

fit_xy()

  • model supports sparsity, turn into sparse matrix and use xy interface
  • model doesn't support, turn back to normal tibble with warning

fit()

  • model supports sparsity, turn into sparse matrix and use xy interface
  • model doesn't support, turn back to normal tibble with warning

@EmilHvitfeldt EmilHvitfeldt requested a review from topepo August 29, 2024 23:49
@simonpcouch
Copy link
Copy Markdown
Contributor

So awesome.

Copy link
Copy Markdown
Member

@topepo topepo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Just one question

Comment thread R/sparsevctrs.R
}

materialize_sparse_tibble <- function(x, object, input) {
if ((!allow_sparse(object)) && is_sparse_tibble(x)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the same case as f2faed9?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it is. i just refactored it out as we need it a couple of places

@EmilHvitfeldt EmilHvitfeldt merged commit f66a8f9 into main Sep 4, 2024
@EmilHvitfeldt EmilHvitfeldt deleted the sparse-tibbles-fit branch September 4, 2024 16:54
@github-actions
Copy link
Copy Markdown
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.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants