当前位置:网站首页>机器学习-集成学习
机器学习-集成学习
2022-07-21 22:37:00 【InfoQ】
1.什么是集成学习
- Bagging为【放回抽样】方法来创建训练集,来分别构建多个分类器。通过多个分类器的投票来预测新数据。 典型算法为随机森林。
- Boosting为【提升方法】,即不断的减少监督学习的偏差来构建强分类器,越到后面的弱分类越关注前一个弱分类器出错的样本。典型算法有AdaBoost和GBDT(梯度迭代决策树)
- Bagging中每个训练集互不相关,也就是每个基分类器互不相关,而Boosting中训练集要在上一轮的结果上进行调整,也使得其不能并行计算
- Bagging中预测函数是均匀平等的,但在Boosting中预测函数是加权的

- 随机森林
- AdaBoost
- GBDT(梯度迭代决策树)
2. 随机森林
- (1)每一棵决策树就是一个精通于某一个窄领域的专家(因为我们从M个feature中选择m让每一棵决策树进行学习),这样在随机森林中就有了很多个精通不同领域的专家,
- (2)对一个新的问题(新的输入数据),可以用不同的角度去看待它,最终由各个专家,投票得到结果
- (3) 关键参数: n_estimators 决策树个数, max_features 随机选择的特征数

X = iris.data
y = iris.target
from sklearn.ensemble import RandomForestClassifier
model = RandomForestClassifier(max_depth=5, n_estimators=10, max_features=1)
model.fit(X,y)
model.score(X, y)
print(model.predict([X[1,],X[2,]]))
2.Adaboost

from sklearn.ensemble import AdaBoostClassifier
X = iris.data
y = iris.target
model=AdaBoostClassifier(n_estimators=20)
model.fit(X,y)
model.score(X, y)
print(model.predict([X[100,],X[2,]]))
3.GBDT(梯度迭代决策树)算法

from sklearn.ensemble import GradientBoostingClassifier
X = iris.data
y = iris.target
model=GradientBoostingClassifier(n_estimators=100, learning_rate=1.0, max_depth=1,random_state=0)
model.fit(X,y)
model.score(X, y)
print(model.predict([X[100,],X[2,]]))
边栏推荐
- ECCV 2022 | 形状、纹理和颜色在视觉识别中的作用
- 小程序毕设作品之微信酒店预订小程序毕业设计(3)后台功能
- 【2022国赛模拟】最小生成树——Kruskal、矩阵、树剖动态DP
- inspire people! Metaverse Wealth outlet of next generation Internet
- 小程序毕设作品之微信酒店预订小程序毕业设计(1)开发概要
- 《6》 BFC
- Acl-ijcai-sigir top conference paper report meeting (AIS 2022) Note 1: recommendation system
- 技术人员突然离职,如何接手他的项目?
- [recommended collection] handling method of cache avalanche
- MATLAB数字图像处理 大作业:人脸表情识别
猜你喜欢
Analysis on DNS domain name hijacking of mobile terminal in IM instant messaging development
JS console alert repl error variable variable declaration promotion data type typeof
requests库中使用response.json()报错:json.decoder.JSONDecodeError: Expecting value
ACL - ijcai - Sigir top Conference Paper Presentation (ais 2022) Note 1: Recommended System
2022.07.20
【技术】uniapp 之引入 u-charts 部分demo
The graduation design of wechat hotel reservation applet (3) background function
小程序毕设作品之微信酒店预订小程序毕业设计(1)开发概要
Configure SSL certificate for Baidu cloud virtual machine BCH
Exploration of new mode of code free production
随机推荐
2022.07.18
Multidimensional track, best selection | cloud store hot list in July
97 page digital twin enabled smart Park IOT cloud platform construction scheme
「运维有小邓」通过审计用户活动和AD域内部变化来确保GDPR合规
The logic of archives | important concepts in archives classification
What are the characteristics of ball screen projection with different implementation methods
2022.07.20
Analysis on the difference between repayment methods of equal principal and equal principal and interest
ECCV 2022 | 面向视听零样本学习的时间和跨模态注意
Aike AI frontier promotion (7.21)
2022 音视频技术风向标
Acl-ijcai-sigir top conference paper report meeting (AIS 2022) Note 1: recommendation system
How can a technician take over his project when he suddenly leaves?
watch在项目中的使用
2022山东健康展,健康产业展,DJK中国健博会,睡眠健康展
ECCV 2022 | the role of shape, texture and color in visual recognition
2022大健康产业展,山东大健康展会,健康膳食展,特医食品展
新能源_光伏逆变器
PIP common commands
Selenium启动chrome,页面显示与隐藏事件