机器学习实战(三)集成学习

集成学习肯定是在实战中最不可或缺的思想了.毕竟都想把错误率低一点,再低一点,再低一点.看看kaggle大量的集成学习就知道这节肯定绕不过去了.
官方文档:[Ensemble methods](http://scikit-learn.org/stable/modules/ensemble.html
bagging的原理介绍可以看:机器学习笔记十三:Ensemble思想(上)

在这里,仅仅说一下最基本的bagging的类,至于更加具体的随机森林或者boosting方法会具体的开一篇来写。bagging有两个类,一个是BaggingClassifier,还有一个是BaggingRegressor,两种形式都是类似的,所以之详细说BaggingClassifier,另外一个类比就行。

class sklearn.ensemble.BaggingClassifier(base_estimator=None,n_estimators=10, max_samples=1.0,max_features=1.0,bootstrap=True,bootstrap_features=False,oob_score=False,warm_start=False, n_jobs=1, random_state=None, verbose=0)

参数:
base_estimator : 一个对象或者None,默认是None,这里是传入一个基本的学习器对象,比如Ridge对象啊,等等。要是None的话,学习器就是决策树。
n_estimators : int类型,表示基本学习器的数量。默认是10
max_samples : int类型或者float类型, 默认为1.0. 这个参数表示从数据集X中抽出多少的数据用来训练基本的学习器。当为整数的时候,就抽出整数个样本,当为浮点数的时候,就抽出该比例的样本。
max_features : int or float, optional (default=1.0)
The number of features to draw from X to train each base estimator.
If int, then draw max_features features.
If float, then draw max_features * X.shape[1] features.
bootstrap : boolean, optional (default=True)
Whether samples are drawn with replacement.
bootstrap_features : boolean, optional (default=False)
Whether features are drawn with replacement.
oob_score : bool
Whether to use out-of-bag samples to estimate the generalization error.
warm_start : bool, o

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值