step_ols: step_ols

View source: R/api_recipes.R

step_olsR Documentation

step_ols

Description

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

Usage

step_ols(.rec, formula, role = "predictor", do_response = TRUE, ...)

Arguments

.rec

the R6 recipe object.

formula

formula for the regression

role

character - the name of the role

do_response

logical calculate and return the responses?

...

additional arguments

Value

an updated recipe

See Also

Other ols: step_nls()

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.