为什么安装文件中没有增压器参数?

2024-09-30 18:20:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经安装了XGBoost。 执行以下操作时显示的参数: 打印(xgboost.xgb分类器())

XGBClassifier(base_score=0.5, colsample_bylevel=1, colsample_bytree=1,
   gamma=0, learning_rate=0.1, max_delta_step=0, max_depth=3,
   min_child_weight=1, missing=None, n_estimators=100, nthread=-1,
   objective='binary:logistic', reg_alpha=0, reg_lambda=1,
   scale_pos_weight=1, seed=0, silent=True, subsample=1)

但是在文档Scikit-Learn API中,出现了一个“booster”参数。为什么我没有呢?在

^{pr2}$

编辑

我得到的是:

    ---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-63-26499cfcb8f8> in <module>()
     18         #Inicio de Cross-validation
     19         clf = Pipeline([('rcl', RobustScaler()),
---> 20                         ('clf',    xgboost.XGBClassifier(booster='gbtree', objective='multi:softmax', seed=0,  nthread=-1))])
     21         ##############4 epoch x sujeto###########
     22         print("4 epoch x sujeto en test_size")

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

Tags: 参数regmaxseedclfweightboosterobjective
1条回答
网友
1楼 · 发布于 2024-09-30 18:20:49

依我看,这是一个很糟糕的矛盾,你应该公开讨论。在

但是xgbpython类或多或少是围绕这样一个事实而设计的:您可以通过train方法在包中设置参数。在

因此,您可以通过以下方式提供助推器方法:

clf = xgb.XGBClassifier()
params = {"booster" : "gbtree"}
xgb.train(params, ...)

相关问题 更多 >