undersample_hclust | R Documentation |
Undersample a dataset by hierarchical clustering.
undersample_hclust(data, cls, cls_col, m, k = 5, h = NA, ...)
data |
Dataset to be undersampled. |
cls |
Majority class that will be undersampled. |
cls_col |
Column in data containing class memberships. |
m |
Number of samples in undersampled dataset. |
k |
Number of clusters to derive from clustering. |
h |
Height at which to cut the clustering tree. |
... |
Additional arguments passed to |
Undersampled dataframe containing only cls
.
table(iris$Species)
undersamp <- undersample_hclust(iris, "setosa", "Species", 15)
nrow(undersamp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.