oversample {mlr} | R Documentation |
Over- or undersample binary classification task to handle class imbalancy.
Description
Oversampling: For a given class (usually the smaller one) all existing observations are taken and copied and extra observations are added by randomly sampling with replacement from this class.
Undersampling: For a given class (usually the larger one) the number of observations is reduced (downsampled) by randomly sampling without replacement from this class.
Usage
oversample(task, rate, cl = NULL)
undersample(task, rate, cl = NULL)
Arguments
task |
(Task) |
rate |
( |
cl |
( |
Value
Task.
See Also
Other imbalancy:
makeOverBaggingWrapper()
,
makeUndersampleWrapper()
,
smote()