xgboost - 为什么即使默认值包含在搜索空间中,网格搜索找到的最佳参数的性能也比默认值差
问题描述
我使用了Analytics Vidhya中给出的步骤。在其中一个步骤中,它具有以下内容:
param_test4 = {'subsample':[i/10.0 for i in range(6,10)],
'colsample_bytree':[i/10.0 for i in range(6,10)]
}
gsearch4 = GridSearchCV(estimator = XGBClassifier( learning_rate =0.1,
n_estimators=177,
max_depth=4,
min_child_weight=6,
gamma=0,
subsample=0.8,
colsample_bytree=0.8,
objective= 'binary:logistic',
nthread=4,
scale_pos_weight=1,seed=27),
param_grid = param_test4,
scoring='roc_auc',
n_jobs=4,
iid=False,
cv=5)
gsearch4.fit(train[predictors],train[target])
gsearch4.grid_scores_, gsearch4.best_params_, gsearch4.best_score_
我已经尝试过这段代码(根据我自己的数据)。在对 中的参数进行网格搜索之前
,我确实为和param_test4
拟合了模型。即使这两个值在 中设置的参数列表中,网格搜索的输出也比直接使用, 和直接使用更差。我想知道是否有人以前见过这个问题/情况。subsample=0.8
colsample_bytree=0.8
param_test4
subsample=0.8
colsample_bytree=0.8
谢谢
解决方案
推荐阅读
- javascript - TypeError:无法读取 null 的属性“play”,即使它在反应中不是 null
- python - 有没有办法在 python selenium 的数字输入上使用 send_keys?
- c# - CS1069:在命名空间中找不到类型名称“RegistryKey”
- c# - UWP ScrollViewer 滚动使用鼠标滚轮但不使用触摸
- python - 我可以在列表理解中的条件中使用“或”吗?
- flutter - 为什么 Flutter 不生成国际化文件?
- angular - 如何以编程方式更新 MatChipList?
- c# - LINQ 选择按数组索引分组和排序的前 1 个
- javascript - 未捕获的 TypeError:{function} 不是 HTMLButtonElement.onclick 中的函数。我该如何解决这个错误?
- python-3.x - SAP HANA hdblci 包 - 使用列名获取数据