set_engine: Declare a computational engine and specific arguments

Description Usage Arguments Value Examples

View source: R/engines.R

Description

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

1
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 varying().

Value

An updated model specification.

Examples

1
2
3
4
5
6
# First, set general arguments using the standardized names
mod <-
  logistic_reg(mixture = 1/3) %>%
  # now say how you want to fit the model and another other options
  set_engine("glmnet", nlambda = 10)
translate(mod, engine = "glmnet")

parsnip documentation built on July 8, 2020, 7:22 p.m.