| adasyn | R Documentation |
Generates synthetic positive instances using ADASYN algorithm.
adasyn(df, var, k = 5, over_ratio = 1, distance = "euclidean")
df |
data.frame or tibble. Must have 1 factor variable and remaining numeric variables. |
var |
Character, name of variable containing factor variable. |
k |
An integer. Number of nearest neighbor that are used to generate the new examples of the minority class. |
over_ratio |
A numeric value for the ratio of the minority-to-majority frequencies. The default value (1) means that all other levels are sampled up to have the same frequency as the most occurring level. A value of 0.5 would mean that the minority levels will have (at most) (approximately) half as many rows as the majority level. A named numeric vector can be used instead to give different levels
different targets, for example |
distance |
A character string specifying the distance metric used for
nearest neighbor calculations, defaulting to
The probability divergences are meaningful for compositional predictors such as proportions or counts normalized per observation, and are generally not appropriate for standardized predictors. |
ADASYN is an extension of SMOTE that adaptively generates synthetic minority class examples based on the local distribution of each minority instance. Instead of generating the same number of synthetic examples for every minority instance, ADASYN generates more synthetic examples for instances that are harder to learn, specifically those surrounded by more majority class neighbors. This focuses synthetic data generation on the difficult boundary regions of the minority class, resulting in a more informative augmentation than standard SMOTE.
All columns used in this function must be numeric with no missing data.
A data.frame or tibble, depending on type of df.
He, H., Bai, Y., Garcia, E. and Li, S. 2008. ADASYN: Adaptive synthetic sampling approach for imbalanced learning. Proceedings of IJCNN 2008. (IEEE World Congress on Computational Intelligence). IEEE International Joint Conference. pp.1322-1328.
step_adasyn() for step function of this method
Other Direct Implementations:
bsmote(),
cluster_centroids(),
cnn(),
enn(),
instance_hardness(),
kmeans_smote(),
ncl(),
nearmiss(),
oss(),
rose(),
smogn(),
smote(),
smoten(),
smotenc(),
svmsmote(),
tomek()
circle_numeric <- circle_example[, c("x", "y", "class")]
res <- adasyn(circle_numeric, var = "class")
res <- adasyn(circle_numeric, var = "class", k = 10)
res <- adasyn(circle_numeric, var = "class", over_ratio = 0.8)
res <- adasyn(circle_numeric, var = "class", distance = "manhattan")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.