Skip to contents

recipes::recipe() step for normalizing data per group. Most of the times we want to normalize each time series independently as they might have different scales.

Usage

step_group_normalize(
  recipe,
  ...,
  groups,
  stats = NULL,
  role = NA,
  trained = FALSE,
  skip = FALSE,
  id = recipes::rand_id("group_normalize")
)

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 variables for this step. See selections() for more details.

groups

<tidy-select> Columns to group by before computing normalization statistics.

stats

Is modified by prep. A data frame containing one row per distinct group, containing the normalization statistics.

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.

skip

A logical. Should the step be skipped when the recipe is baked by bake()? While all operations are baked when prep() 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.