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

add toggle_sparsity() #281

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

add toggle_sparsity() #281

wants to merge 2 commits into from

Conversation

EmilHvitfeldt
Copy link
Member

@EmilHvitfeldt EmilHvitfeldt commented Jan 15, 2025

to close #271

I think this is the last puzzle piece to make sparsity useful in tidymodels.

This will toggle the sparsity creation of recipes based on whether or not we estimate it will be useful or not.

all(res$allow_sparse_x[res$engine == x$engine])
}

pred_log_fold <- function(sparsity, model, n_rows) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This is generated from a mars model, using sparsity, model and n_rows from https://github.com/tidymodels/benchmark-sparsity-threshold

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not married to this specific model. I'm fine with fine-tuning a little more. but it works fine as is

Comment on lines +43 to +45
if (is.null(model) || model == "ranger") {
return("no")
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Screenshot 2025-01-15 at 1 32 52 PM

since ranger performs identically for both sparse and dense data, we turn off automatically

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

Successfully merging this pull request may close these issues.

sparse toggling mechanic
1 participant