step_nls | R Documentation |
Uses the Eigen C++ library fast versions to generate predictions and coefficients from a recipe.
step_nls(
.rec,
formula,
algorithm = "lm",
n_subset = 1L,
n_shift = 0L,
range = c(-Inf, Inf),
control = gsl_nls_control(xtol = 1e-08),
trace = FALSE,
role = "predictor",
...
)
.rec |
the R6 recipe object. |
formula |
formula for the regression |
algorithm |
character string specifying the algorithm to use. The following choices are supported:
|
n_subset |
integer - spacing between adjacent samples in the result. |
n_shift |
integer - number of values to shift the starting position when n_subset is not equal to 0. The value of n_shift has to be less than 'n_subset'. |
range |
limit the fitting range to observations between range[1] and range[2] |
control |
an optional list of control parameters to tune the least squares iterations and multistart algorithm.
See |
trace |
logical value indicating if a trace of the iteration progress should be printed.
Default is |
role |
character - the name of the role |
... |
additional arguments |
an updated recipe
Other ols:
step_ols()
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()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.