step_nls: step_nls

View source: R/api_recipes.R

step_nlsR Documentation

step_nls

Description

Uses the Eigen C++ library fast versions to generate predictions and coefficients from a recipe.

Usage

step_nls(
  .rec,
  formula,
  role = "predictor",
  algorithm = "lm",
  n_subset = 1L,
  n_shift = 0L,
  ...
)

Arguments

.rec

the R6 recipe object.

formula

formula for the regression

role

character - the name of the role

...

additional arguments

do_response

logical calculate and return the responses?

do_predict

calculate and return the predictions?

Value

an updated recipe

See Also

Other ols: step_ols()

Examples

data("kennel_2020")
kennel_2020[, datetime := as.numeric(datetime)]
formula <- as.formula(wl~.)
n_knots <- 12
deg_free <- 27
max_lag <- 1 + 720

frec = recipe(formula = formula, data = unclass(kennel_2020)) |>
  step_distributed_lag(baro, knots = hydrorecipes:::log_lags_arma(n_knots, max_lag)) |>
  step_spline_b(datetime, df = deg_free, intercept = FALSE) |>
  step_intercept() |>
  step_drop_columns(baro) |>
  step_drop_columns(datetime) |>
  step_ols(formula) |>
  prep() |>
  bake()

jkennel/hydrorecipes documentation built on Dec. 24, 2024, 5:38 p.m.