Standardizing variables

In the previous models, we fixed a parameter that standardized the data. However, this option is not available in the autoML function. Thus, the variables will be standardized first. The columns will have zero mean and unit variance. We need to standardize the variables because otherwise the results will have dominating variables that seem to have a higher variance compared to other attributes as a consequence of their scale.

Standardization is done using the caret package. First, we choose the name of numeric columns to standardize:

library(caret)features <- setdiff(names(train), c("ID_RSSD","Default"))

The variables are transformed with the preProcess function:

pre_process <- preProcess(x = train[, features],  method ...

Get Machine Learning with R Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.