mold: Mold data for modeling

Description Usage Arguments Value Examples

View source: R/mold.R

Description

mold() applies the appropriate processing steps required to get training data ready to be fed into a model. It does this through the use of various blueprints that understand how to preprocess data that come in various forms, such as a formula or a recipe.

All blueprints have consistent return values with the others, but each is unique enough to have its own help page. Click through below to learn how to use each one in conjunction with mold().

Usage

1
mold(x, ...)

Arguments

x

An object. See the method specific implementations linked in the Description for more information.

...

Not used.

Value

A named list containing 4 elements:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# See the method specific documentation linked in Description
# for the details of each blueprint, and more examples.

# XY
mold(iris[, "Sepal.Width", drop = FALSE], iris$Species)

# Formula
mold(Species ~ Sepal.Width, iris)

# Recipe
library(recipes)
mold(recipe(Species ~ Sepal.Width, iris), iris)

DavisVaughan/hardhat documentation built on Oct. 5, 2021, 9:53 a.m.