preprocess: Create a preprocessing pipeline: a list of Preprocessor...

Description Usage Arguments Examples

View source: R/Preprocessor.R

Description

Typical usage will be: train <- pipe$fit_transform(train) test <- pipe$transform(test)

Usage

1

Arguments

...

The preprocessor objects.

Examples

1
2
3
4
5
6
df <- data.frame(a=c(1,2,NA,3), b=c(10,20,30,NA), c=c("c1", "c2", "c3", "c4"), D=rep("d", 4), X=c(1,2,3,NA))
pipe <- preprocess(remove_constants(), impute(numerics, mean, na.rm=TRUE), impute(categoricals, most_frequent))
pipe$fit(df)
pipe$transform(df)
# or more succintly
pipe$fit_transform(df)

rtsho/preprocessr documentation built on May 29, 2019, 8:58 a.m.