SMOTE (Synthetic Minority Oversampling Technique), synthetic minority oversampling. It is based on random sampling algorithm through an improved scheme, due to random samples taken over a simple strategy to increase sample copy minority class sample, so prone to the problem of over-fitting model, even if the information was to study the model too special (Specific ) and not generalized (General), the basic idea of the algorithm is to SMOTE minority class samples are analyzed and added to the data set according to the synthetic minority sample a new sample, as shown particularly in FIG algorithm procedure is as follows.
- (1) For each sample of minority x, Euclidean distance calculated as the standard to which the minority class sample set from all samples to obtain its k neighbors.
- (2) The sample imbalance ratio provided a sample to determine the sampling rate ratio N, for each of a minority of samples x, several randomly selected samples from k-nearest neighbor, assuming the neighbor is selected o.
- (3) randomly selected for each neighbor o, respectively, with the original sample according to the formula o (new) = o + rand (0,1) * (xo) Construction of a new sample.
smote算法的伪代码如下:
该算法主要存在两方面的问题:一是在近邻选择时,存在一定的盲目性。从上面的算法流程可以看出,在算法执行过程中,需要确定K值,即选择多少个近邻样本,这需要用户自行解决。从K值的定义可以看出,K值的下限是M值(M值为从K个近邻中随机挑选出的近邻样本的个数,且有M< K),M的大小可以根据负类样本数量、正类样本数量和数据集最后需要达到的平衡率决定。但K值的上限没有办法确定,只能根据具体的数据集去反复测试。因此如何确定K值,才能使算法达到最优这是未知的。
另外,该算法无法克服非平衡数据集的数据分布问题,容易产生分布边缘化问题。由于负类样本的分布决定了其可选择的近邻,如果一个负类样本处在负类样本集的分布边缘,则由此负类样本和相邻样本产生的“人造”样本也会处在这个边缘,且会越来越边缘化,从而模糊了正类样本和负类样本的边界,而且使边界变得越来越模糊。这种边界模糊性,虽然使数据集的平衡性得到了改善,但加大了分类算法进行分类的难度.
针对SMOTE算法存在的边缘化和盲目性等问题,很多人纷纷提出了新的改进办法,在一定程度上改进了算法的性能,但还存在许多需要解决的问题。
Han等人Borderline-SMOTE: A New Over-Sampling Method in Imbalanced Data Sets Learning在SMOTE算法基础上进行了改进,提出了Borderhne.SMOTE算法,解决了生成样本重叠(Overlapping)的问题该算法在运行的过程中,查找一个适当的区域,该区域可以较好地反应数据集的性质,然后在该区域内进行插值,以使新增加的“人造”样本更有效。这个适当的区域一般由经验给定,因此算法在执行的过程中有一定的局限性。