Learn R Programming

tidysynthesis (version 0.1.2)

synth_spec_tuner_api: Add, update, or remove tuners from a synth_spec object

Description

Add, update, or remove tuners from a synth_spec object

Usage

add_custom_tuners(synth_spec, ...)

update_custom_tuners(synth_spec, ...)

remove_custom_tuners(synth_spec)

Value

A new synth_spec object.

A new synth_spec object with added custom tuners.

A new synth_spec object with updated custom tuners.

A new synth_spec object with removed custom tuners.

Arguments

synth_spec

A synth_spec object

...

Optional named lists with two elements, vars and tuner, mapping variable names to tuners.

Examples

Run this code

synth_spec <- synth_spec()

tuner1 <- list(
  v = 3,
  grid = 3,
  metrics = yardstick::metric_set(yardstick::rmse)
)

add_custom_tuners(
  synth_spec = synth_spec, 
  list("vars" = c("a", "b", "c"), "tuner" = tuner1)
)


synth_spec <- synth_spec()

tuner1 <- list(
  v = 3,
  grid = 3,
  metrics = yardstick::metric_set(yardstick::rmse)
)

update_custom_tuners(
  synth_spec = synth_spec, 
  list("vars" = c("a", "b", "c"), "tuner" = tuner1)
)


synth_spec <- synth_spec()

tuner1 <- list(
  v = 3,
  grid = 3,
  metrics = yardstick::metric_set(yardstick::rmse)
)

synth_spec <- add_custom_tuners(
  synth_spec = synth_spec, 
  list("vars" = c("a", "b", "c"), "tuner" = tuner1)
)

remove_custom_tuners(synth_spec = synth_spec)

Run the code above in your browser using DataLab