A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://parsnip.tidymodels.org/reference/set_engine.html below:

Declare a computational engine and specific arguments — set_engine • parsnip

set_engine() is used to specify which package or system will be used to fit the model, along with any arguments specific to that software.

Usage
set_engine(object, engine, ...)
Arguments
object

A model specification.

engine

A character string for the software that should be used to fit the model. This is highly dependent on the type of model (e.g. linear regression, random forest, etc.).

...

Any optional arguments associated with the chosen computational engine. These are captured as quosures and can be tuned with tune().

Value

An updated model specification.

Details

In parsnip,

Use show_engines() to get a list of possible engines for the model of interest.

Modeling functions in parsnip separate model arguments into two categories:

Examples
# First, set main arguments using the standardized names
logistic_reg(penalty = 0.01, mixture = 1/3) |>
  # Now specify how you want to fit the model with another argument
  set_engine("glmnet", nlambda = 10) |>
  translate()
#> Logistic Regression Model Specification (classification)
#> 
#> Main Arguments:
#>   penalty = 0.01
#>   mixture = 1/3
#> 
#> Engine-Specific Arguments:
#>   nlambda = 10
#> 
#> Computational engine: glmnet 
#> 
#> Model fit template:
#> glmnet::glmnet(x = missing_arg(), y = missing_arg(), weights = missing_arg(), 
#>     alpha = 1/3, nlambda = 10, family = "binomial")

# Many models have possible engine-specific arguments
decision_tree(tree_depth = 5) |>
  set_engine("rpart", parms = list(prior = c(.65,.35))) |>
  set_mode("classification") |>
  translate()
#> Decision Tree Model Specification (classification)
#> 
#> Main Arguments:
#>   tree_depth = 5
#> 
#> Engine-Specific Arguments:
#>   parms = list(prior = c(0.65, 0.35))
#> 
#> Computational engine: rpart 
#> 
#> Model fit template:
#> rpart::rpart(formula = missing_arg(), data = missing_arg(), weights = missing_arg(), 
#>     maxdepth = 5, parms = list(prior = c(0.65, 0.35)))

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4