Skip to content

set_args() can be used to modify the arguments of a model specification while set_mode() is used to change the model's mode.

Usage

set_args(object, ...)

set_mode(object, 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")

Value

An updated model object.

Details

set_args() will replace existing values of the arguments.

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 
#>