R/tools.R
format_target.Rd
Formats a target as a 0/1 variable. If target is numeric, 1 = above average.
format_target(target)
Variable as vector
Formated target
iris$is_virginica <- ifelse(iris$Species == "virginica", "yes", "no") iris$target <- format_target(iris$is_virginica) table(iris$target) #> #> 0 1 #> 100 50