Description Usage Arguments Value Examples
Wrapper that encapsulates a collection of algorithms to perform a class balancing preprocessing task for binary class datasets
1 2 3 4 5 6 7 8 9 10 |
dataset |
A binary class |
ratio |
Number between 0 and 1 indicating the desired ratio between
minority examples and majority ones, that is, the quotient size of
minority class/size of majority class. There are methods, such as
|
method |
A |
filtering |
Logical (TRUE or FALSE) indicating wheter to apply filtering
of oversampled instances with |
classAttr |
|
wrapper |
A |
... |
Further arguments to apply in selected method |
A balanced data.frame
with same structure as dataset
,
containing both original instances and new ones
1 2 3 4 5 6 7 8 9 | data(glass0)
# Oversample glass0 to get an imbalance ratio of 0.8
imbalanceRatio(glass0)
# 0.4861111
newDataset <- oversample(glass0, ratio = 0.8, method = "MWMOTE")
imbalanceRatio(newDataset)
newDataset <- oversample(glass0, method = "ADASYN")
newDataset <- oversample(glass0, ratio = 0.8, method = "SMOTE")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.