create_starterframe: Set up a nested data frame with transformations

Description Usage Arguments Value Examples

Description

In many machinelearning projects you want to start with original values, but also transformations of those values. This function combines all transformations into 1 nested dataframe that contains the transformed data frames

Usage

1
2
create_starterframe(transformations = list(), y = NULL, .suffix = NULL,
  .prefix = NULL)

Arguments

transformations

a named list of transformations

y

the values you want to predict, can be empty

.suffix

a vector of the same length as the transformation list that contains the suffix you want to apply to your variables

.prefix

a vector of the same length as the transformation list that contains the prefix you want to apply to your variables

Value

a nested data frame with trainingsets, name and y values (if supplied)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
\notrun{
library(mlbench)
data("BostonHousing")
prepTrain <- preProcess(x = BostonHousing[,preds.original], method = c('BoxCox'))
data_transformation(list(
      original = BostonHousing[,1:13],
      boxcoxed = predict(prepTrain,newdata = BostonHousing[,preds.original]),
      squared  = (BostonHousing[,c(1:3,5:13)])^2
       ),
        .suffix = c(NA, "boxed","squared"))
}

rsangole/tidyrabbit documentation built on May 30, 2019, 7:06 p.m.