powered by
Balances the target variable in your dataset using downsampling. Target must be 0/1, FALSE/TRUE ore no/yes
balance_target(data, target, min_prop = 0.1, seed)
Data
A dataset
Target variable (0/1, TRUE/FALSE, yes/no)
Minimum proportion of one of the target categories
Seed for random number generator
iris$is_versicolor <- ifelse(iris$Species == "versicolor", 1, 0) balanced <- balance_target(iris, target = is_versicolor, min_prop = 0.5) describe(balanced, is_versicolor)
Run the code above in your browser using DataLab