undersample_kmeans | R Documentation |
Undersample a dataset by kmeans clustering.
undersample_kmeans(data, cls, cls_col, m, k = 5, ...)
data |
Dataset to be undersampled. |
cls |
Class to be undersampled. |
cls_col |
Column containing class information. |
m |
Number of samples in undersampled dataset. |
k |
Number of centers in clustering. |
... |
Additional arguments passed to |
The undersampled dataframe containing only instances of cls
.
table(iris$Species)
undersamp <- undersample_kmeans(iris, "setosa", "Species", 15)
nrow(undersamp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.