Description Usage Arguments Details Value Author(s) Examples
downSample
will randomly sample a data set so that all classes have the same frequency as the minority class. upSample
samples with replacement to make the class distributions equal
1 2 3 |
x |
a matrix or data frame of predictor variables |
y |
a factor variable with the class memberships |
list |
should the function return |
yname |
if |
Simple random sampling is used to down-sample for the majority class(es). Note that the minority class data are left intact and that the samples will be re-ordered in the down-sampled version.
For up-sampling, all of the original data are left intact and additional samples are added to the minority classes with replacement.
Either a data frame or a list with elements x
and y
.
Max Kuhn
1 2 3 4 5 6 | ## A ridiculous example...
data(oil)
table(oilType)
downSample(fattyAcids, oilType)
upSample(fattyAcids, oilType)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.