resample_random | R Documentation |
This function is used to resample a dataset by randomly removing or duplicating rows. It is usable for both oversampling and undersampling.
resample_random(data, cls, cls_col, m)
data |
Dataframe to be resampled. |
cls |
Class that should be randomly resampled. |
cls_col |
Column containing class information. |
m |
Desired number of samples. |
Resampled dataframe containing only cls
.
set.seed(1234)
only2 <- resample_random(wine, 2, "type", 15)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.