Learn R Programming

recipes (version 1.1.0)

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

173,696

Version

1.1.0

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Last Published

July 4th, 2024

Functions in recipes (1.1.0)

discretize

Discretize Numeric Variables
fixed

Helper Functions for Profile Data Sets
detect_step

Detect if a particular step or check is used in a recipe
formula.recipe

Create a formula from a prepared recipe
fully_trained

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

Get types for use in recipes
check_range

Check range consistency
format_ch_vec

Helpers for printing step functions
developer_functions

Developer functions for creating recipes steps
check_type

Quantitatively check on variables
juice

Extract transformed training set
prep

Estimate a preprocessing recipe
names0

Naming Tools
print.recipe

Print a Recipe
has_role

Role Selection
reexports

Objects exported from other packages
recipes_eval_select

Evaluate a selection with tidyselect semantics specific to recipes
recipe

Create a recipe for preprocessing data
prepper

Wrapper function for preparing recipes within resampling
yj_transform

Internal Functions
get_keep_original_cols

Get the keep_original_cols value of a recipe step
recipes_extension_check

Checks that steps have all S3 methods
remove_original_cols

Removes original columns if options apply
recipes-role-indicator

Role indicators
recipes

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

Update packages
rand_id

Make a random identification field for steps
recipes_ptype

Prototype of recipe object
selections

Methods for selecting variables in step functions
step_arrange

Sort rows using dplyr
step_bs

B-spline basis functions
step_bin2factor

Create a factors from A dummy variable
step_BoxCox

Box-Cox transformation for non-negative data
recipes_remove_cols

Removes columns if options apply
recipes_ptype_validate

Validate prototype of recipe object
step_bagimpute

Impute via bagged trees
step

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

Yeo-Johnson transformation
roles

Manually alter roles
required_pkgs.step_classdist_shrunken

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

Distances to class centroids
step_depth

Data depths
step_center

Centering numeric data
step_date

Date feature generator
step_count

Create counts of patterns using regular expressions
step_cut

Cut a numeric variable into a factor
step_corr

High correlation filter
step_classdist_shrunken

Compute shrunken centroid distances for classification models
step_dummy

Create traditional dummy variables
step_discretize

Discretize Numeric Variables
step_filter_missing

Missing value column filter
step_factor2string

Convert factors to strings
step_holiday

Holiday feature generator
step_harmonic

Add sin and cos terms for harmonic analysis
step_hyperbolic

Hyperbolic transformations
step_dummy_extract

Extract patterns from nominal data
step_dummy_multi_choice

Handle levels in multiple predictors together
step_filter

Filter rows using dplyr
step_geodist

Distance between two locations
step_ica

ICA signal extraction
step_indicate_na

Create missing data column indicators
step_impute_median

Impute numeric data using the median
step_impute_linear

Impute numeric variables via a linear model
step_impute_mode

Impute nominal data using the most common value
step_impute_lower

Impute numeric data below the threshold of measurement
step_impute_roll

Impute numeric data using a rolling window statistic
step_impute_mean

Impute numeric data using the mean
step_impute_bag

Impute via bagged trees
step_impute_knn

Impute via k-nearest neighbors
step_integer

Convert values to predefined integers
step_kpca_rbf

Radial basis function kernel PCA signal extraction
step_interact

Create interaction variables
step_inverse

Inverse transformation
step_lag

Create a lagged predictor
step_intercept

Add intercept (or constant) column
step_kpca

Kernel PCA signal extraction
step_kpca_poly

Polynomial kernel PCA signal extraction
step_isomap

Isomap embedding
step_invlogit

Inverse logit transformation
step_knnimpute

Impute via k-nearest neighbors
step_logit

Logit transformation
step_mutate

Add new variables using dplyr
step_modeimpute

Impute nominal data using the most common value
step_lincomb

Linear combination filter
step_log

Logarithmic transformation
step_naomit

Remove observations with missing values
step_lowerimpute

Impute numeric data below the threshold of measurement
step_mutate_at

Mutate multiple columns using dplyr
step_meanimpute

Impute numeric data using the mean
step_medianimpute

Impute numeric data using the median
step_ns

Natural spline basis functions
step_ordinalscore

Convert ordinal factors to numeric scores
step_num2factor

Convert numbers to factors
step_other

Collapse infrequent categorical levels
step_novel

Simple value assignments for novel factor levels
step_nnmf

Non-negative matrix factorization signal extraction
step_normalize

Center and scale numeric data
step_pca

PCA signal extraction
step_nnmf_sparse

Non-negative matrix factorization signal extraction with lasso penalization
step_nzv

Near-zero variance filter
step_poly

Orthogonal polynomial basis functions
step_profile

Create a profiling version of a data set
step_poly_bernstein

Generalized bernstein polynomial basis
step_relevel

Relevel factors to a desired level
step_ratio

Ratio variable creation
step_regex

Detect a regular expression
step_relu

Apply (smoothed) rectified linear transformation
step_range

Scaling numeric data to a specific range
step_percentile

Percentile transformation
step_pls

Partial least squares feature extraction
step_rm

General variable filter
step_spatialsign

Spatial sign preprocessing
step_select

Select variables using dplyr
step_rollimpute

Impute numeric data using a rolling window statistic
step_rename

Rename variables by name using dplyr
step_sample

Sample rows using dplyr
step_shuffle

Shuffle variables
step_rename_at

Rename multiple columns using dplyr
step_scale

Scaling numeric data
step_slice

Filter rows by position using dplyr
step_spline_b

Basis splines
step_unknown

Assign missing categories to "unknown"
step_spline_convex

Convex splines
step_spline_monotone

Monotone splines
step_string2factor

Convert strings to factors
step_spline_nonnegative

Non-negative splines
step_time

Time feature generator
step_spline_natural

Natural splines
step_sqrt

Square root transformation
step_unorder

Convert ordered factors to unordered factors
summary.recipe

Summarize a recipe
step_window

Moving window functions
step_zv

Zero variance filter
terms_select

Select terms in a step function.
update_role_requirements

Update role specific requirements
update.step

Update a recipe step
tidy.step_BoxCox

Tidy the result of a recipe
case_weights

Using case weights with recipes
check_class

Check variable class
add_step

Add a New Operation to the Current Recipe
check_name

check that newly created variable names don't overlap
check_cols

Check if all columns are present
bake

Apply a trained preprocessing recipe
case-weight-helpers

Helpers for steps with case weights
check_new_values

Check for new values
check_missing

Check for missing values
check_new_data

Check for required column at bake-time