step_bottom_code_quant: Bottom code numeric features based on quantile

Description Usage Arguments

View source: R/bottom_code_quant.R

Description

step_bottom_code_quant creates a specification of a recipe step that will bottom code numeric data using a quantile learned on a training set.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
step_bottom_code_quant(
  recipe,
  ...,
  role = NA,
  trained = FALSE,
  ref_val = NULL,
  prob = 0.02,
  skip = FALSE,
  id = recipes::rand_id("bottom_code_quant")
)

Arguments

recipe

A recipe object. The step will be added to the sequence of operations for this recipe.

...

One or more selector functions to choose which variables are affected by the step. See selections() for more details. For the tidy method, these are not currently used.

role

Not used by this step since no new variables are created.

trained

A logical to indicate if the quantities for preprocessing have been estimated.

ref_val

A float, learned from the training data, representing the prob quantile of the predictor.

prob

A float providing the quantile at which to bottom code

skip

A logical. Should the step be skipped when the recipe is baked by bake.recipe()? While all operations are baked when prep.recipe() is run, some operations may not be able to be conducted on new data (e.g. processing the outcome variable(s)). Care should be taken when using skip = TRUE as it may affect the computations for subsequent operations

id

A character string that is unique to this step to identify it.


Strabes/recipes.ext documentation built on Dec. 18, 2021, 3:02 p.m.