当前位置:网站首页>深入理解机器学习——类别不平衡学习(Imbalanced Learning):样本采样技术-[人工采样技术之ADASYN采样法]
深入理解机器学习——类别不平衡学习(Imbalanced Learning):样本采样技术-[人工采样技术之ADASYN采样法]
2022-07-17 00:33:00 【von Neumann】
分类目录:《深入理解机器学习》总目录
与Borderline-SMOTE算法相类似,ADASYN(Adaptive Synthetic Sampling)算法也是一种改进的SMOTE算法。该算法于2008年提出,其主要思想是充分利用样本的密度分布信息来确定各少数类样本用作主样本的频次,为少数较难学习的类别样本合成更多的训练数据,从而尽可能修正类别不平衡分布所产生的负面影响。
ADASYN算法首先要确定需生成的新少数类样本数,即 N + × SR N^+\times \text{SR} N+×SR,然后在原始训练集 S S S上找到每个少数类样本 x i + , i = 1 , 2 , ⋯ , N + x_i^+, i=1, 2, \cdots, N^+ xi+,i=1,2,⋯,N+的 K K K近邻,其中,第 i i i个少数类样本的多数类近邻数记为 N i major N_i^\text{major} Nimajor,进而可通过下式确定每个少数类样本各自的比例参数 Γ i \Gamma_i Γi:
Γ i = N i major Z × K \Gamma_i=\frac{N_i^\text{major}}{Z\times K} Γi=Z×KNimajor
其中, Z Z Z为标准化因子,用以保证 ∑ Γ i = 1 \sum\Gamma_i=1 ∑Γi=1。在比例参数确定后,即可通过下式确定每个少数类样本被选作主样本的频次:
g i = Γ i × N + × SR g_i=\Gamma_i\times N^+\times\text{SR} gi=Γi×N+×SR
从上式不难看出,与Borderline-SMOTE算法相似,ADASYN算法更关注那些位于决策边界附近的少数类样本,它们被选作主样本的频次远远高于那些位于少数类决策区域内的样本。当然,这也会进一步放大少数类噪声信息的传播强度,ADASYN算法的具体流程如下:
ADASYN采样法
输入:训练集 S = { ( x i , y i ) , i = 1 , 2 , ⋯ , N , y i ∈ { + , − } } S=\{(x_i, y_i), i=1, 2, \cdots, N, y_i\in\{+, -\}\} S={(xi,yi),i=1,2,⋯,N,yi∈{ +,−}};多数类样本数 N − N^- N−,少数类样本数 N + N^+ N+,其中 N − + N + = N N^-+N^+=N N−+N+=N;不平衡比率 IR = N − N + \text{IR}=\frac{N^-}{N^+} IR=N+N−;采样率 SR \text{SR} SR;邻近参数 K K K
输出:过采样后的训练集 S = { ( x i , y i ) , i = 1 , 2 , ⋯ , N + N + × SR , y i ∈ { + , − } } S=\{(x_i, y_i), i=1, 2, \cdots, N+N^+\times \text{SR}, y_i\in\{+, -\}\} S={(xi,yi),i=1,2,⋯,N+N+×SR,yi∈{ +,−}}
( 1 ) 从训练集 S S S中取出全部多数类与少数类样本,组成多数类训练样本集 S − S^- S−及少数类训练样本集 S + S^+ S+
( 2 ) 置新生成样本集 S New S^\text{New} SNew为空+
( 3 ) for i = 1 : N + i=1:N^+ i=1:N+
( 4 ) \quad 在 S + S^+ S+中找到对应样本 x i x_i xi
( 5 ) \quad 在 S S S中找到 x i x_i xi的 K K K近邻,记录其多数类近邻数为 N major N^{\text{major}} Nmajor
( 6 ) \quad 计算其比例参数: Γ i = N i major Z × K \Gamma_i=\frac{N_i^\text{major}}{Z\times K} Γi=Z×KNimajor
( 7 ) \quad 计算其主样本频次: g i = Γ i × N + × SR g_i=\Gamma_i\times N^+\times\text{SR} gi=Γi×N+×SR
( 8 ) for i = 1 : N + i=1:N^+ i=1:N+
( 9 ) \quad 在 S + S^+ S+中随机选出一个主样本 x i x_i xi
(10) \quad for i = 1 : g i i=1:g_i i=1:gi
(11) \qquad 调用SMOTE算法生成主样本 x i x_i xi的新样本 x i new x_i^\text{new} xinew
(12) \qquad 添加 x i new x_i^\text{new} xinew至 S New S^\text{New} SNew: S New = S New ∪ x i new S^\text{New}=S^\text{New}\cup x_i^\text{new} SNew=SNew∪xinew
(13) return 过采样后的训练集 S ′ = S − ∪ S New S'=S^-\cup S^\text{New} S′=S−∪SNew
边栏推荐
- 【单片机仿真】(九)指令系统 — 算术运算指令 之 ADD、ADDC、SUBB、INC、DEC、DA
- [regression prediction] lithium ion battery life prediction based on particle filter with matlab code
- mysqldump: [Warning] Using a password on the command line interface can be insecure.
- Fiddler grabbing
- 乐视还有400多位员工?过着没有老板的神仙日子 官方出来回应了...
- Elk log analysis system
- [MCU simulation] (VI) addressing mode - index addressing and relative addressing
- 4年开发二面美团最终败给:volatile关键字作用和原理这道面试题
- HCIA_ Rip experiment
- Detailed explanation of dynamic compression and static compression of gzip
猜你喜欢

BiSeNetV2-面部分割
![[NoSQL] redis master-slave, sentinel, cluster](/img/69/37b80398617040984b006d3d7b71b9.png)
[NoSQL] redis master-slave, sentinel, cluster

2. Actual use of asynctool framework

RHCE ansible second operation

工具及方法 - Excel插件XLTools

Redis' simple dynamic string SDS

多项式插值拟合(二)

Learning network foundation

Detailed explanation of case when usage of SQL

The place where the dream begins ---- first knowing C language
随机推荐
Analysis skills of time complexity and space complexity
Understand network namespaces
C language foundation day4 array
1. Introduction, analysis and implementation of asynctool framework
[MCU simulation] (II) keil installation tutorial
多表查询——案例练习
【PHP】tp6多表连接查询
ncnn paramdict&modelbin
while 循环
RHCE ansible first operation
显而易见的事情
當你在Linux系統中編譯安裝MySQL數據庫卡住了怎麼辦?
Tools and methods - Excel plug-in xltools
Built in keyboard continuous 444
Understand JVM garbage collection in one article
JDBC连接Mysql数据库
Upgrade kubernetes 1.23.2 to 1.24.1
Configure VLAN and use OSPF protocol for layer 3 switches
What happens when you get stuck compiling and installing MySQL database in Linux system?
Elk log analysis system