[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
<>1 简介
本文根据2008 IEEE的《ADASYN: Adaptive Synthetic Sampling Approach for Imbalanced
Learning》翻译总结的。
ADASYN: Adaptive Synthetic,自适应合成。根据不同的少数样本其学习的困难程度,使用权重分布,为少数较难学习的类别样本合成更多的训练数据
。看下面算法只是生成了少数较难学习的类别样本。
ADASYN不仅可以减少原始不平衡数据分布导致的学习偏见,而且可以自适应偏移决策边界,使其聚焦于那些较难学习的样本上。
ADASYN支持两分类,也支持多类别分类。
处理不平衡学习问题有下面五个方向:
1)采用策略:过采样(oversampling)、欠采样(undersampling)。
2)合成数据生成:人工生成数据。如SMOTE、SMOTE-Boost、DataBoost-IM。ADASYN就是借鉴了SMOTE、SMOTE-Boost、DataBoost-IM后设计的。
3)成本分析Cost-sensitive学习。为不同错误类型或者实例类型,使用一个成本矩阵(cost-matrix)来帮助学习不平衡数据。也就是说,成本分析学习没有直接修改不平衡数据分布,而是靠使用不同的成本矩阵(cost-matrix)来描述对任一特殊数据错误分类的成本。
4)Active learning.主动学习。
5)Kernel-based 方法.
<>2 ADASYN算法
<>2.1 输入
<>2.2 过程
<>2.3 其他
<>3 实验
<>3.1评测指标
我们采用决策树作为模型。采用Overall Accuracy (OA)、G_mean评价结果。
<>3.2 实验结果
可以看到在G_mean评测下,ADASYN取得了很好的成绩。ADASYN在少数类别和多数类别上都有提升,而不是通过牺牲一个类别来提升另一个类别的准确率。
<>4 代码实现
from imblearn.over_sampling import SMOTE, ADASYN
oversample = ADASYN(random_state=40)
X = train_data_c[features]
Y = train_data_c[‘label’]
X, Y = oversample.fit_resample(X, Y)