Using SMOTEBoost and RUSBoost to deal with class imbalance

from:https://aitopics.org/doc/news:1B9F7A99/

Binary classification with strong class imbalance can be found in many real-world classification problems. From trying to predict events such as network intrusion and bank fraud to a patient's medical diagnosis, the goal in these cases is to be able to identify instances of the minority class -- that is, the class that is underrepresented in the dataset. This, of course, presents a big challenge as most predictive models tend to ignore the more critical minority class while deceptively giving high accuracy results by favoring the majority class. Several techniques have been used to get around the problem of class imbalance, including different sampling methods and modeling algorithms. Examples of sampling methods include adding data samples to the minority class by either duplicating the data or generating synthetic minority samples (oversampling), or randomly removing majority class data to produce a more balanced data distribution (undersampling).

kaggle上建议:摘自:https://www.kaggle.com/general/7793

One approach that I have used in the past was to use a clustering algorithm for the majority class, the negative cases in your example, to create a smaller, representative set of negative cases with which to replace the actual negative cases in the training data.

More specifically, I used K-means algorithm to cluster the negative cases into the x clusters where x is the number of positive examples in my training data. Then I used the cluster centroids as the negative cases and the actual positive cases as the positives. This gave me a 50 / 50 balanced data set for the training. (Note that I only did this for the training data. My cross validation and test sets I kept unclustered).

There are downsides to this approach:

By clustering you lose some accuracy in the negative cases, but that is the price you pay with this approach.
    Also, K-means algorithm can converge on a different set of centroids each time you run it as it starts at random starting positions. In optimising the model, I regenerated the negative centroids several times to get different data for the training.

其实rusboost还是很先进的,见下文:

CUSBoost:基于聚类的提升下采样的非平衡数据分类

原论文地址:CUSBoost: Cluster-based Under-sampling with Boosting for Imbalanced Classification

Abstract

普通的机器学习方法,对于非平衡数据分类,总是倾向于最大化占比多的类别的分类准确率,而把占比少的类别分类错误,但是,现实应用中,我们研究的问题,对于少数的类别却更加感兴趣。最近,处理非平衡数据分类问题的方法有:采样方法,成本敏感的学习方法,以及集成学习的方法。这篇文章中,提出了一种新的基于聚类的欠采样boosting方法,CUSBoost,它能够有效地处理非平衡数据分类问题。RUSBoost(random under-sampling with AdaBoost) 和SMOTEBoost (synthetic minority over-sampling with AdaBoost) 算法,在我们提出的算法中作为可选项。经过实验,我们发现CUSBoost算法在处理非平衡数据上能够达到state-of-art的表现,其表现优于一般的集成学习方法。

Introduction

处理非平衡类别问题的方法一般被分为两类:外部(对非平衡数据进行处理得到平衡的数据)、内部(通过降低非平衡类别数据的灵敏度来改变已有的学习算法)的方法。

而CUSBoost的处理方法是:首先把数据分开为少数类别实例和多数类别实例,然后使用K-means算法对多数类别实例进行聚类处理,并且从每个聚类中选择部分数据来组成平衡的数据。聚类的方法帮助我们在多数类别数据中选择了差异性更大的数据(同一个聚类里面的数据则选择的相对较少),比起那些随机采样的方法(随机丢弃多数类别的数据)。CUSBoost combines the sampling and boosting methods to form an efficient and effective algorithm for class imbalance learning.

Related work

Sun等人提出的处理非平衡的二分类问题的方法,首先将大多数类别数据随机分组,每个组内的数据数量和少数类别的数据数量相近。然后由多数类每个组的数据加少数类数据进而组成平衡的数据样本。

Chawla 等人提出一种过采样方法SMOTE,对少数类别数据进行over-sample,不同之处在于,采样的数据是由少数类别数据合成而来。它通过操作特征空间而不是数据空间来合成少数类别的数据(使用KNN)。

Seiffert等人给出的结合Adaboost的随机欠采样方法RUSBoost,RUS减少多数类别的数据组成平衡数据(结合Adaboost)。

CUSBoost Algorithm

CUSBoost是聚类采样和Adaboost方法的结合:
聚类采样:把多数类数据和少数类数据分开,在多数类数据中,使用K-means算法将其分为K

个聚类(K

采用超参数优化决定)。然后在每个聚类中,使用随机地选择50%的数据(这里可以视具体问题进行调整)。使用选择出来的数据和少数类数据一起组成新的平衡数据。

算法伪代码:

解释一下:步骤三是每一次都实行一次欠采样(对事先已经利用K-means方法得到的K个聚类),组成平衡的数据。

My views

本文提出的算法关键点在于基于聚类的欠采样方法(K-means),然后就是结合Adaboost算法来得到最后的模型。文章后面也给出了实验测试结果,有兴趣的可以看一下,可以得到一下几个结论:

  • 总体相比RUSBoostSMOTEBoost来说,该方法分类性能具有显著优越的效果;
  • 正是基于聚类的采样方法,导致了如果数据的特征空间非常适合聚类的时候,该方法将表现地较好。否则,可能需要尝试其他方法了;
  • 该算法结合了Adaboost,其实用其他算法模型来代替也不是不可以的,比如当前很火的Xgboost

Using SMOTEBoost(过采样) and RUSBoost(使用聚类+集成学习) to deal with class imbalance的更多相关文章

  1. OpenCV计算机视觉学习(12)——图像量化处理&图像采样处理(K-Means聚类量化,局部马赛克处理)

    如果需要处理的原图及代码,请移步小编的GitHub地址 传送门:请点击我 如果点击有误:https://github.com/LeBron-Jian/ComputerVisionPractice 准备 ...

  2. Self-paced Clustering Ensemble自步聚类集成论文笔记

    Self-paced Clustering Ensemble自步聚类集成论文笔记 2019-06-23 22:20:40 zpainter 阅读数 174  收藏 更多 分类专栏: 论文   版权声明 ...

  3. 多视图子空间聚类/表示学习(Multi-view Subspace Clustering/Representation Learning)

    多视图子空间聚类/表示学习(Multi-view Subspace Clustering/Representation Learning) 作者:凯鲁嘎吉 - 博客园 http://www.cnblo ...

  4. 聚类算法学习-kmeans,kmedoids,GMM

    GMM参考这篇文章:Link 简单地说,k-means 的结果是每个数据点被 assign 到其中某一个 cluster 了,而 GMM 则给出这些数据点被 assign 到每个 cluster 的概 ...

  5. K-Means聚类算法原理

    K-Means算法是无监督的聚类算法,它实现起来比较简单,聚类效果也不错,因此应用很广泛.K-Means算法有大量的变体,本文就从最传统的K-Means算法讲起,在其基础上讲述K-Means的优化变体 ...

  6. ML: 聚类算法-概论

    聚类分析是一种重要的人类行为,早在孩提时代,一个人就通过不断改进下意识中的聚类模式来学会如何区分猫狗.动物植物.目前在许多领域都得到了广泛的研究和成功的应用,如用于模式识别.数据分析.图像处理.市场研 ...

  7. 03-01 K-Means聚类算法

    目录 K-Means聚类算法 一.K-Means聚类算法学习目标 二.K-Means聚类算法详解 2.1 K-Means聚类算法原理 2.2 K-Means聚类算法和KNN 三.传统的K-Means聚 ...

  8. 机器学习(十)—聚类算法(KNN、Kmeans、密度聚类、层次聚类)

    聚类算法 任务:将数据集中的样本划分成若干个通常不相交的子集,对特征空间的一种划分. 性能度量:类内相似度高,类间相似度低.两大类:1.有参考标签,外部指标:2.无参照,内部指标. 距离计算:非负性, ...

  9. K-Means 聚类算法

    K-Means 概念定义: K-Means 是一种基于距离的排他的聚类划分方法. 上面的 K-Means 描述中包含了几个概念: 聚类(Clustering):K-Means 是一种聚类分析(Clus ...

随机推荐

  1. 《TomCat与Java Web开发技术详解》(第二版) 第六章节的学习总结 ---- JSP技术

    第六章主要介绍了JSP的相关知识. 1.JSP:是通过在HTML文件中加入java程序片段(Java Scriptlet)和JSP标记,就构成了JSP文件.JSP实质上是Servlet.JSP的API ...

  2. The Pilots Brothers' refrigerator - poj 2965

      Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 20325   Accepted: 7830   Special Judg ...

  3. B. Worms Codeforces Round #271 (div2)

    B. Worms time limit per test 1 second memory limit per test 256 megabytes input standard input outpu ...

  4. poj3708(公式化简+大数进制装换+线性同余方程组)

    刚看到这个题目,有点被吓到,毕竟自己这么弱. 分析了很久,然后发现m,k都可以唯一的用d进制表示.也就是用一个ai,和很多个bi唯一构成. 这点就是解题的关键了. 之后可以发现每次调用函数f(x),相 ...

  5. 【BZOJ1345】[Baltic2007]序列问题Sequence 贪心+单调栈

    [BZOJ1345][Baltic2007]序列问题Sequence Description 对于一个给定的序列a1, …, an,我们对它进行一个操作reduce(i),该操作将数列中的元素ai和a ...

  6. 【BZOJ4184】shallot 线段树+vector+线性基

    [BZOJ4184]shallot Description 小苗去市场上买了一捆小葱苗,她突然一时兴起,于是她在每颗小葱苗上写上一个数字,然后把小葱叫过来玩游戏. 每个时刻她会给小葱一颗小葱苗或者是从 ...

  7. android菜鸟学习笔记22----ContentProvider(二)ContentObserver的简单使用

    现在有这样一个应用A通过ContentProvider提供自己的数据给其他应用,应用B通过ContentResolver获取应用A中提供的数据,并将其展示在ListView中,而应用C通过Conten ...

  8. Linux c编程:线程属性

    前面介绍了pthread_create函数,并且当时的例子中,传入的参数都是空指针,而不是指向pthread_attr_t结构的指针.可以使用pthread_attr_t结构修改线程默认属性,并把这些 ...

  9. python数据分析之:时间序列二

    将Timestamp转换为Period 通过使用to_period方法,可以将由时间戳索引的Series和DataFrame对象转换为以时期索引 rng=pd.date_range('1/1/2000 ...

  10. (转载)C #开源框架

    Json.NET http://json.codeplex.com/ Json.Net 是一个读写Json效率比较高的.Net框架.Json.Net 使得在.Net环境下使用Json更加简单.通过Li ...