set_args()
can be used to modify the arguments of a model specification while
set_mode()
is used to change the model's mode.
Arguments
- object
A model specification.
- ...
One or more named model arguments.
- mode
A character string for the model type (e.g. "classification" or "regression")
Examples
rand_forest()
#> Random Forest Model Specification (unknown mode)
#>
#> Computational engine: ranger
#>
rand_forest() %>%
set_args(mtry = 3, importance = TRUE) %>%
set_mode("regression")
#> Random Forest Model Specification (regression)
#>
#> Main Arguments:
#> mtry = 3
#>
#> Engine-Specific Arguments:
#> importance = TRUE
#>
#> Computational engine: ranger
#>