Description Usage Arguments Examples
Upsamples the minority class in binary classification setting to the size of majority class by randomly selecting minority class with repition to match the number of majority class
1 2 | upsample_minority(x, classVarName, arrangeVarName, seed = 100,
shuffle = FALSE)
|
x |
A dataframe |
classVarName |
Name of the binary class column |
arrangeVarName |
Name of the variable to arrange by |
seed |
Seed chosen for sampling, defaults to 100 |
shuffle |
Whether to shuffle the dataframe at the end. This cannot be TRUE when arrangeVarName is specified. Shuffle used the seed value seed + 1. |
1 2 3 4 | iris2 <- iris[c(1:25, 51:100), ]
iris2$Species <- factor(iris2$Species)
sampled <- upsample_minority(iris2, "Species")
table(sampled$Species)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.