Skip to contents

Takes in a recipe and will scale values using a selected recipe. To call the recipe use a quoted argument like "sinh", "cosh" or "tanh".

Usage

hai_data_trig(
  .recipe_object = NULL,
  ...,
  .type_of_scale = "sinh",
  .inverse = FALSE
)

Arguments

.recipe_object

The data that you want to process

...

One or more selector functions to choose variables to be imputed. When used with imp_vars, these dots indicate which variables are used to predict the missing data in each variable. See selections() for more details

.type_of_scale

This is a quoted argument and can be one of the following:

  • "sinh"

  • "cosh"

  • "tanh"

.inverse

A logical: should the inverse function be used? Default is FALSE

Value

A list object

Details

This function will get your data ready for processing with many types of ml/ai models.

This is intended to be used inside of the data processor and therefore is an internal function. This documentation exists to explain the process and help the user understand the parameters that can be set in the pre-processor function.

recipes::step_hyperbolic()

Author

Steven P. Sanderson II, MPH

Examples

suppressPackageStartupMessages(library(dplyr))
suppressPackageStartupMessages(library(recipes))

date_seq <- seq.Date(from = as.Date("2013-01-01"), length.out = 100, by = "month")
val_seq <- rep(rnorm(10, mean = 6, sd = 2), times = 10)
df_tbl <- tibble(
  date_col = date_seq,
  value    = val_seq
)

rec_obj <- recipe(value ~ ., df_tbl)

hai_data_trig(
  .recipe_object = rec_obj,
  value,
  .type_of_scale = "sinh"
)$scale_rec_obj %>%
  get_juiced_data()
#> # A tibble: 100 × 2
#>    date_col     value
#>    <date>       <dbl>
#>  1 2013-01-01 7434.  
#>  2 2013-02-01  163.  
#>  3 2013-03-01 1439.  
#>  4 2013-04-01    6.52
#>  5 2013-05-01   38.2 
#>  6 2013-06-01 1822.  
#>  7 2013-07-01  142.  
#>  8 2013-08-01  288.  
#>  9 2013-09-01   49.9 
#> 10 2013-10-01   29.5 
#> # ℹ 90 more rows