Random Over-Sampling Examples (ROSE, 2014)
ROSE.RdGenerates synthetic data for each class to balance imbalanced datasets using kernel density estimations. Can be used for multiclass datasets.
Arguments
- x
feature matrix or data.frame.
- y
a factor class variable. Can be multiclass.
- h
A numeric vector of length one or number of classes in y. If one is given, all classes will have same shrink factor. If a value is given for each classes, it will match respectively to
levels(y). Default is 1.- ovRate
Oversampling rate. Class \(j\) receives
round(ovRate * (n_max - n_j))synthetic samples, wheren_maxis the size of the largest class (halves are rounded up). Default is 1 meaning full balance. A vector with one value per class is also accepted.
Value
a list with resampled dataset.
- x_new
Resampled feature matrix.
- y_new
Resampled target variable.
Details
Year: 2014.
Randomly Over Sampling Examples (ROSE) (Menardi and Torelli, 2014) is an oversampling method which uses conditional kernel densities to balance dataset. There is already an R package called `ROSE` (Lunardon et al., 2014). Difference is that this one is much faster and can be applied for more than two classes.

