Skip to content

How to parse extension package arguments to parsnip? #1241

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

Closed
marcelglueck opened this issue Jan 29, 2025 · 3 comments
Closed

How to parse extension package arguments to parsnip? #1241

marcelglueck opened this issue Jan 29, 2025 · 3 comments

Comments

@marcelglueck
Copy link

I am currently using bag_mlp() with the nnet engine. I know that engine-specific arguments may be parsed through set_engine(). However, I am wondering whether there is a straightforward way to do the same with extension package arguments.

For instance, how do I parse the times argument from baguette::bagger() without having to change the default values of baguette:bagger() itself?

Many thanks for your assistance.

@topepo
Copy link
Member

topepo commented Feb 1, 2025

Good question that we have not documented well.

short answer: you pass arguments to the underlying function using set_engine() so use set_engine("nnet", times = 50).

longer answer: when you go to the help page for bag_mlp, there are links to the engine-specific functions, and these tell you the underlying function (like bagger()). Any options passed to set_engine() are passed to that function.

@marcelglueck
Copy link
Author

That seems to work. Thanks!

Copy link

This issue 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 Feb 20, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants