Learn R Programming

healthyR.ai (version 0.1.0)

hai_data_poly: Data Preprocessor - Polynomial Function

Description

Takes in a recipe and will scale values using a selected recipe.

Usage

hai_data_poly(.recipe_object = NULL, ..., .p_degree = 2)

Value

A list object

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

.p_degree

The polynomial degree, an integer.

Author

Steven P. Sanderson II, MPH

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_poly()

See Also

https://recipes.tidymodels.org/reference/step_poly.html

Other Data Recipes: hai_data_impute(), hai_data_scale(), hai_data_transform(), hai_data_trig(), pca_your_recipe()

Other Preprocessor: hai_c50_data_prepper(), hai_cubist_data_prepper(), hai_data_impute(), hai_data_scale(), hai_data_transform(), hai_data_trig(), hai_earth_data_prepper(), hai_glmnet_data_prepper(), hai_knn_data_prepper(), hai_ranger_data_prepper(), hai_svm_poly_data_prepper(), hai_svm_rbf_data_prepper(), hai_xgboost_data_prepper()

Examples

Run this code
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_poly(
  .recipe_object = rec_obj,
  value
)$scale_rec_obj %>%
  get_juiced_data()

Run the code above in your browser using DataLab