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

ancillary objects and S3 methods for models #31

Open
topepo opened this issue Oct 20, 2020 · 0 comments
Open

ancillary objects and S3 methods for models #31

topepo opened this issue Oct 20, 2020 · 0 comments

Comments

@topepo
Copy link
Collaborator

topepo commented Oct 20, 2020

As I'm writing the party package methods for #30, I thought that it might be helpful to list some other connections to make to other tidymodels packages

Parameter objects

If you have any tuning parameters that need dials objects, we could take a dials dependency and add them here or add a PR to dials. I would only add them to dials if you think that there are other models/packages that would be able to use them. For my PR, I'll keep them in treesnip since they are specific to conditional inference trees.

Tuning related things

There are also two other components that probably need some specification to work better with tune.

First, if there are tuning parameters that can use multi_predict(), you will want to set up an S3 min_grid() method. This basically tells tune how to use the submodes efficiently. tune exports a function called fit_max_value() that makes this pretty easy.

Second, if there are parameters that people will want to tune but are not main arguments, you can better enable that to happen by listing them as tunable parameters with the S3 method tunable. Basically it just lists their argument names and the corresponding dials object that should be used. This is described in details on tidymodels.org.

For example, for the randomForest engine, people might want to tune over maxnodes. tune contains this tibble to set that up:

> tune:::randomForest_engine_args
# A tibble: 1 x 5
  name     call_info        source     component   component_id
  <chr>    <list>           <chr>      <chr>       <chr>       
1 maxnodes <named list [2]> model_spec rand_forest engine      
> tune:::randomForest_engine_args$call_info
[[1]]
[[1]]$pkg
[1] "dials"

[[1]]$fun
[1] "max_nodes"

For both of these tune-related items, they need underlying functions in tune so it would be better to PR into tune for them. I'll set that up in a PR for the party models and link to this issue to help make it easier.

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

1 participant