forge() applies the transformations requested by the specific
on a set of
new_data contains new predictors
(and potentially outcomes) that will be used to generate predictions.
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
XY Method -
Formula Method -
Recipes Method -
forge(new_data, blueprint, ..., outcomes = FALSE)
A data frame or matrix of predictors to process. If
A logical. Should the outcomes be processed and returned as well?
If the outcomes are present in
new_data, they can optionally be processed
and returned in the
outcomes slot of the returned list by setting
outcomes = TRUE. This is very useful when doing cross validation where
you need to preprocess the outcomes of a test set before computing
A named list with 3 elements:
predictors: A tibble containing the preprocessed
outcomes = TRUE, a tibble containing the preprocessed
outcomes found in
NULL if the blueprint returns no extra information,
or a named list containing the extra information.
# See the blueprint specific documentation linked above # for various ways to call forge with different # blueprints. train <- iris[1:100, ] test <- iris[101:150, ] # Formula processed <- mold( log(Sepal.Width) ~ Species, train, blueprint = default_formula_blueprint(indicators = "none") ) forge(test, processed$blueprint, outcomes = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.