Learn R Programming

⚠️There's a newer version (1.2.1) of this package.Take me there.

recipes (version 1.0.1)

Preprocessing and Feature Engineering Steps for Modeling

Description

A recipe prepares your data for modeling. We provide an extensible framework for pipeable sequences of feature engineering steps provides preprocessing tools to be applied to data. Statistical parameters for the steps can be estimated from an initial data set and then applied to other data sets. The resulting processed output can then be used as inputs for statistical or machine learning models.

Copy Link

Version

Install

install.packages('recipes')

Monthly Downloads

158,337

Version

1.0.1

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Max Kuhn

Last Published

July 7th, 2022

Functions in recipes (1.0.1)

check_new_data

Check for required column at bake-time
check_cols

Check if all Columns are Present
check_class

Check Variable Class
detect_step

Detect if a particular step or check is used in a recipe
yj_transform

Internal Functions
discretize

Discretize Numeric Variables
recipe

Create a recipe for preprocessing data
case_weights

Using case weights with recipes
case-weight-helpers

Helpers for steps with case weights
fixed

Helper Functions for Profile Data Sets
format_ch_vec

Helpers for printing step functions
recipes

recipes: A package for computing and preprocessing design matrices.
prep

Estimate a preprocessing recipe
get_keep_original_cols

Get the keep_original_cols value of a recipe step
prepper

Wrapper function for preparing recipes within resampling
recipes_pkg_check

Update packages
step_count

Create Counts of Patterns using Regular Expressions
check_new_values

Check for New Values
formula.recipe

Create a Formula from a Prepared Recipe
step_date

Date Feature Generator
roles

Manually Alter Roles
rand_id

Make a random identification field for steps
fully_trained

Check to see if a recipe is trained/prepared
print.recipe

Print a Recipe
step_depth

Data Depths
reexports

Objects exported from other packages
selections

Methods for selecting variables in step functions
step_holiday

Holiday Feature Generator
step_cut

Cut a numeric variable into a factor
step_harmonic

Add sin and cos terms for harmonic analysis
required_pkgs.step_depth

S3 methods for tracking which additional packages are needed for steps.
step_geodist

Distance between two locations
step

step sets the class of the step and check is for checks.
step_filter_missing

Missing Value Column Filter
step_impute_linear

Impute numeric variables via a linear model
step_indicate_na

Create Missing Data Column Indicators
step_log

Logarithmic Transformation
step_integer

Convert values to predefined integers
step_logit

Logit Transformation
has_role

Role Selection
step_impute_lower

Impute numeric data below the threshold of measurement
step_lincomb

Linear Combination Filter
step_lag

Create a lagged predictor
recipes_eval_select

Evaluate a selection with tidyselect semantics specific to recipes
step_corr

High Correlation Filter
step_classdist

Distances to Class Centroids
step_dummy_extract

Extract patterns from nominal data
step_relu

Apply (Smoothed) Rectified Linear Transformation
step_relevel

Relevel factors to a desired level
step_ns

Natural Spline Basis Functions
step_dummy_multi_choice

Handle levels in multiple predictors together
step_num2factor

Convert Numbers to Factors
step_kpca_poly

Polynomial Kernel PCA Signal Extraction
step_profile

Create a Profiling Version of a Data Set
step_kpca_rbf

Radial Basis Function Kernel PCA Signal Extraction
step_BoxCox

Box-Cox Transformation for Non-Negative Data
step_impute_mode

Impute nominal data using the most common value
step_ratio

Ratio Variable Creation
step_scale

Scaling Numeric Data
step_select

Select variables using dplyr
update.step

Update a recipe step
step_nzv

Near-Zero Variance Filter
step_spatialsign

Spatial Sign Preprocessing
step_impute_median

Impute numeric data using the median
step_impute_mean

Impute numeric data using the mean
step_inverse

Inverse Transformation
step_string2factor

Convert Strings to Factors
step_range

Scaling Numeric Data to a Specific Range
update_role_requirements

Update role specific requirements
step_time

Time Feature Generator
step_novel

Simple Value Assignments for Novel Factor Levels
check_range

Check Range Consistency
step_pca

PCA Signal Extraction
step_dummy

Create traditional dummy variables
check_type

Quantitatively check on variables
step_ordinalscore

Convert Ordinal Factors to Numeric Scores
names0

Naming Tools
juice

Extract transformed training set
step_nnmf

Non-Negative Matrix Factorization Signal Extraction
step_invlogit

Inverse Logit Transformation
step_naomit

Remove observations with missing values
step_interact

Create Interaction Variables
step_percentile

Percentile Transformation
step_arrange

Sort rows using dplyr
step_bin2factor

Create a Factors from A Dummy Variable
step_discretize

Discretize Numeric Variables
step_YeoJohnson

Yeo-Johnson Transformation
step_hyperbolic

Hyperbolic Transformations
step_bs

B-Spline Basis Functions
step_impute_roll

Impute numeric data using a rolling window statistic
step_isomap

Isomap Embedding
step_center

Centering numeric data
step_ica

ICA Signal Extraction
step_nnmf_sparse

Non-Negative Matrix Factorization Signal Extraction with lasso Penalization
step_filter

Filter rows using dplyr
step_factor2string

Convert Factors to Strings
step_impute_bag

Impute via bagged trees
step_mutate

Add new variables using dplyr
step_impute_knn

Impute via k-nearest neighbors
tidy.step_BoxCox

Tidy the Result of a Recipe
step_sqrt

Square Root Transformation
step_unorder

Convert Ordered Factors to Unordered Factors
step_rm

General Variable Filter
step_other

Collapse Some Categorical Levels
terms_select

Select Terms in a Step Function.
step_unknown

Assign missing categories to "unknown"
step_sample

Sample rows using dplyr
summary.recipe

Summarize a recipe
step_shuffle

Shuffle Variables
step_regex

Detect a regular expression
step_kpca

Kernel PCA Signal Extraction
step_normalize

Center and scale numeric data
step_poly

Orthogonal Polynomial Basis Functions
step_slice

Filter rows by position using dplyr
step_pls

Partial Least Squares Feature Extraction
step_intercept

Add intercept (or constant) column
step_mutate_at

Mutate multiple columns using dplyr
step_rename_at

Rename multiple columns using dplyr
step_rename

Rename variables by name using dplyr
step_zv

Zero Variance Filter
step_window

Moving Window Functions
bake

Apply a trained preprocessing recipe
add_step

Add a New Operation to the Current Recipe
check_missing

Check for Missing Values
check_name

check that newly created variable names don't overlap