library(recipes)
rec <- recipe(~ ., data = as.data.frame(iris))
bn_trans <- step_best_normalize(rec, all_numeric())
bn_estimates <- prep(bn_trans, training = as.data.frame(iris))
bn_data <- bake(bn_estimates, as.data.frame(iris))
plot(density(iris[, "Petal.Length"]), main = "before")
plot(density(bn_data$Petal.Length), main = "after")
tidy(bn_trans, number = 1)
tidy(bn_estimates, number = 1)
Run the code above in your browser using DataLab