在 XGBClassifier 中设置助推器

setting booster in a XGBClassifier

我阅读了文档,

import xgboost as xgb
class xgboost.XGBClassifier(max_depth=3, learning_rate=0.1,
n_estimators=100, silent=True, objective='binary:logistic',
booster='gbtree', n_jobs=1,nthread=None, gamma=0, min_child_weight=1,
max_delta_step=0, subsample=1, colsample_bytree=1, colsample_bylevel=1, 
reg_alpha=0, reg_lambda=1, scale_pos_weight=1, base_score=0.5, 
random_state=0, seed=None, missing=None, **kwargs)

然后我尝试在 API

之后创建自己的实例
model_benchmark=xgb.XGBClassifier(booster ='linear',objective='binary:logistic')

我得到:

TypeError: __init__() got an unexpected keyword argument 'booster'

关于如何选择我想要的助推器有什么建议吗?

更新:

我查看了 v0.6 的 Github 源代码,没有发现任何与 booster 参数相关的内容。该参数在最新版本的发布中。然而,在 0.6 版本中也有一些关于 Booster 对象的信息,但它可能比最新版本的实现方式更复杂。


根据文档 (http://xgboost.readthedocs.io/en/latest/python/python_api.html):

booster: string
Specify which booster to use: gbtree, gblinear or dart.

没有"linear",应该是"gblinear"。

https://anaconda.org/conda-forge/py-xgboost

以上可以在Anaconda上安装0.80版本的xgboost,有booster参数