step_basis {bases} | R Documentation |
Recipe step for basis expansions
Description
step_basis()
is a single function that creates a specification of a recipe
step that will create new columns that are basis expansions, using any of the
basis expansion functions in this package.
Usage
step_basis(
recipe,
...,
role = NA,
trained = FALSE,
fn = NULL,
options = list(),
object = NULL,
prefix = deparse(substitute(fn)),
skip = FALSE,
id = recipes::rand_id("basis")
)
Arguments
recipe |
A recipe object. |
... |
One or more selector functions to choose variables for this step.
See |
role |
For model terms created by this step, what analysis role should they be assigned? By default, the new columns created by this step from the original variables will be used as predictors in a model. |
trained |
A logical to indicate if the quantities for preprocessing have been estimated. |
fn |
The basis function to use, e.g., |
options |
A list of options for the basis function |
object |
The basis object created once the step has been trained. |
prefix |
The prefix to use for the new column names. Numbers will be
appended, per |
skip |
A logical. Should the step be skipped when the recipe is baked by
|
id |
A character string that is unique to this step to identify it. |
Value
An updated version of recipe with the new step added to the sequence of any existing operations.
Tuning Parameters
There are no tuning parameters made available to the tunable
interface.
Case Weights
The underlying operation does not use case weights.
Examples
rec = recipes::recipe(depth ~ lat + long + mag, quakes)
rec_rff = step_basis(rec, lat, long, fn = b_rff,
options = list(p = 5, kernel = k_rbf(2), stdize="none"))
recipes::bake(recipes::prep(rec_rff), new_data=NULL)