Basic Functions


Apply a Trained Data Recipe


Create a Formula from a Prepared Recipe


Train a Data Recipe


Print a Recipe


Create a Recipe for Preprocessing Data


recipes: A package for computing and preprocessing design matrices.


Summarize a Recipe

tidy(<recipe>) tidy(<step>) tidy(<check>)

Tidy the Result of a Recipe


Extract Finalized Training Set


Methods for Select Variables in Step Functions

has_role() all_predictors() all_outcomes() has_type() all_numeric() all_nominal() current_info()

Role Selection

add_role() update_role() remove_role()

Manually Alter Roles


Wrapper function for preparing recipes within resampling

Step Functions - Imputation

step_bagimpute() imp_vars() tidy(<step_bagimpute>)

Imputation via Bagged Trees

step_knnimpute() tidy(<step_knnimpute>)

Imputation via K-Nearest Neighbors

step_lowerimpute() tidy(<step_lowerimpute>)

Impute Numeric Data Below the Threshold of Measurement

step_meanimpute() tidy(<step_meanimpute>)

Impute Numeric Data Using the Mean

step_medianimpute() tidy(<step_medianimpute>)

Impute Numeric Data Using the Median

step_modeimpute() tidy(<step_modeimpute>)

Impute Nominal Data Using the Most Common Value

step_rollimpute() tidy(<step_rollimpute>)

Impute Numeric Data Using a Rolling Window Statistic

step_unknown() tidy(<step_unknown>)

Assign missing categories to "unknown"

Step Functions - Individual Transformations

step_BoxCox() tidy(<step_BoxCox>)

Box-Cox Transformation for Non-Negative Data

step_bs() tidy(<step_bs>)

B-Spline Basis Functions

step_hyperbolic() tidy(<step_hyperbolic>)

Hyperbolic Transformations

step_inverse() tidy(<step_inverse>)

Inverse Transformation

step_invlogit() tidy(<step_invlogit>)

Inverse Logit Transformation

step_log() tidy(<step_log>)

Logarithmic Transformation

step_logit() tidy(<step_logit>)

Logit Transformation

step_mutate() tidy(<step_mutate>) tidy(<step_mutate_at>)

Add new variables using mutate

step_ns() tidy(<step_ns>)

Nature Spline Basis Functions

step_poly() tidy(<step_poly>)

Orthogonal Polynomial Basis Functions

step_relu() tidy(<step_relu>)

Apply (Smoothed) Rectified Linear Transformation

step_sqrt() tidy(<step_sqrt>)

Square Root Transformation

step_YeoJohnson() tidy(<step_YeoJohnson>)

Yeo-Johnson Transformation

Step Functions - Discretization

discretize() predict(<discretize>)

Discretize Numeric Variables

step_discretize() tidy(<step_discretize>)

Discretize Numeric Variables

step_cut() tidy(<step_cut>)

Cut a numeric variable into a factor

Step Functions - Dummy Variables and Encodings

step_bin2factor() tidy(<step_bin2factor>)

Create a Factors from A Dummy Variable

step_count() tidy(<step_count>)

Create Counts of Patterns using Regular Expressions

step_date() tidy(<step_date>)

Date Feature Generator

step_dummy() tidy(<step_dummy>)

Dummy Variables Creation

step_factor2string() tidy(<step_factor2string>)

Convert Factors to Strings

step_holiday() tidy(<step_holiday>)

Holiday Feature Generator

step_integer() tidy(<step_integer>)

Convert values to predefined integers

step_novel() tidy(<step_novel>)

Simple Value Assignments for Novel Factor Levels

step_num2factor() tidy(<step_num2factor>)

Convert Numbers to Factors

step_ordinalscore() tidy(<step_ordinalscore>)

Convert Ordinal Factors to Numeric Scores

step_other() tidy(<step_other>)

Collapse Some Categorical Levels

step_regex() tidy(<step_regex>)

Create Dummy Variables using Regular Expressions

step_relevel() tidy(<step_relevel>)

Relevel factors to a desired level

step_string2factor() tidy(<step_string2factor>)

Convert Strings to Factors

step_unknown() tidy(<step_unknown>)

Assign missing categories to "unknown"

step_unorder() tidy(<step_unorder>)

Convert Ordered Factors to Unordered Factors

Step Functions - Interactions

step_interact() tidy(<step_interact>)

Create Interaction Variables

Step Functions - Normalization

step_center() tidy(<step_center>)

Centering numeric data

step_normalize() tidy(<step_normalize>)

Center and scale numeric data

step_range() tidy(<step_range>)

Scaling Numeric Data to a Specific Range

step_scale() tidy(<step_scale>)

Scaling Numeric Data

Step Functions - Multivariate Transformations

step_classdist() tidy(<step_classdist>)

Distances to Class Centroids

step_depth() tidy(<step_depth>)

Data Depths

step_geodist() tidy(<step_geodist>)

Distance between two locations

step_ica() tidy(<step_ica>)

ICA Signal Extraction

step_isomap() tidy(<step_isomap>)

Isomap Embedding

step_kpca_poly() tidy(<step_kpca_poly>)

Polynomial Kernel PCA Signal Extraction

step_kpca_rbf() tidy(<step_kpca_rbf>)

Radial Basis Function Kernel PCA Signal Extraction


Mutate multiple columns

step_nnmf() tidy(<step_nnmf>)

NNMF Signal Extraction

step_pca() tidy(<step_pca>)

PCA Signal Extraction

step_pls() tidy(<step_pls>)

Partial Least Squares Feature Extraction

step_ratio() denom_vars() tidy(<step_ratio>)

Ratio Variable Creation

step_spatialsign() tidy(<step_spatialsign>)

Spatial Sign Preprocessing

Step Functions - Filters

step_corr() tidy(<step_corr>)

High Correlation Filter

step_lincomb() tidy(<step_lincomb>)

Linear Combination Filter

step_nzv() tidy(<step_nzv>)

Near-Zero Variance Filter

step_rm() tidy(<step_rm>)

General Variable Filter

step_zv() tidy(<step_zv>)

Zero Variance Filter

Step Functions - Row Operations

step_arrange() tidy(<step_arrange>)

Sort rows using dplyr

step_downsample() tidy(<step_downsample>)

Down-Sample a Data Set Based on a Factor Variable

step_filter() tidy(<step_filter>)

Filter rows using dplyr


Create a lagged predictor

step_naomit() tidy(<step_naomit>)

Remove observations with missing values

step_rollimpute() tidy(<step_rollimpute>)

Impute Numeric Data Using a Rolling Window Statistic

step_sample() tidy(<step_sample>)

Sample rows using dplyr

step_shuffle() tidy(<step_shuffle>)

Shuffle Variables

step_slice() tidy(<step_slice>)

Filter rows by position using dplyr

step_upsample() tidy(<step_upsample>)

Up-Sample a Data Set Based on a Factor Variable

Step Functions - Others


Add intercept (or constant) column

step_profile() tidy(<step_profile>)

Create a Profiling Version of a Data Set

step_rename() tidy(<step_rename>) tidy(<step_rename_at>)

Rename variables by name


Rename multiple columns

step_window() tidy(<step_window>)

Moving Window Functions

Check Functions

check_class() tidy(<check_class>)

Check Variable Class

check_cols() tidy(<check_cols>)

Check if all Columns are Present

check_missing() tidy(<check_missing>)

Check for Missing Values


Check for New Values

check_range() tidy(<check_range>)

Check Range Consistency