Generate a oversampling dataset from imbalanced dataset using Adaptive Neighbor SMOTE which provides the parameter K to each minority instance automatically
ANS(X, target, dupSize = 0)A data frame or matrix of numeric-attributed dataset
A vector of a target class attribute corresponding to a dataset X.
A number of vector representing the desired times of synthetic minority instances over the original number of majority instances, 0 for balanced dataset.
A resulting dataset consists of original minority instances, synthetic minority instances and original majority instances with a vector of their respective target class appended at the last column
A set of synthetic minority instances with a vector of minority target class appended at the last column
A set of original instances whose class is not oversampled with a vector of their target class appended at the last column
A set of original instances whose class is oversampled with a vector of their target class appended at the last column
A vector of parameter K for each minority instance
The value of parameter C for nearest neighbor process used for identifying outcasts
The maximum times of synthetic minority instances over original majority instances in the oversampling
A set of original minority instances which is defined as minority outcast
The value of eps which determines automatic K
The name of oversampling method used for this generated dataset (ANS)
Siriseriwan, W. and Sinapiromsaran, K. Adaptive neighbor Synthetic Minority Oversampling TEchnique under 1NN outcast handling.Songklanakarin Journal of Science and Technology.
# NOT RUN {
data_example = sample_generator(5000,ratio = 0.80)
genData = ANS(data_example[,-3],data_example[,3])
# }
Run the code above in your browser using DataLab