random-forest - 超参数调优;ML 算法的参数空间(rf、adaboost、xgboost)
问题描述
我试图调整几种 ML 算法(rf、adaboost 和 xgboost)的超参数来训练一个以多类分类变量为目标的模型。我正在使用 R 中的 MLR 包。但是,我不确定以下内容。
- 调整哪些超参数(以及使用默认的超参数)
- 调整的超参数的空间应该是多少
您知道我可以找到有关此信息的任何来源吗?
例如;
filterParams(getParamSet("classif.randomForest"), tunable = TRUE)
给
Type len Def Constr Req Tunable Trafo
ntree integer - 500 1 to Inf - TRUE -
mtry integer - - 1 to Inf - TRUE -
replace logical - TRUE - - TRUE -
classwt numericvector <NA> - 0 to Inf - TRUE -
cutoff numericvector <NA> - 0 to 1 - TRUE -
sampsize integervector <NA> - 1 to Inf - TRUE -
nodesize integer - 1 1 to Inf - TRUE -
maxnodes integer - - 1 to Inf - TRUE -
importance logical - FALSE - - TRUE -
localImp logical - FALSE - - TRUE -
空间; 下、上、变换
params_to_tune <- makeParamSet(makeNumericParam("mtry", lower = 0, upper = 1, trafo = function(x) ceiling(x*ncol(train_x))))
解决方案
通常,您希望调整所有标tunable
有值范围的参数,使其尽可能大。在实践中,其中一些不会对性能产生影响,但您通常事先并不知道。
推荐阅读
- visual-studio-code - 如何让 VSCode 在我的虚拟环境中进行调试?
- php - 在所有屏幕上制作可见的响应菜单?
- vue.js - VueJS test-utils 在子组件中找不到元素
- python - 数据框应包含多行,但附加后始终包含单行
- c# - 无法在 avalonia 中显示图像
- python - 我需要一件衣服 c0de
- android - 我应该为此使用哪个视图?安卓工作室
- python - 在 Django Rest Framework 中更新多对多模型
- c++ - 在 C++17 中为整数实现 NaN
- string - 当我的 T 与 Into 绑定时,特征绑定 `String: From<&T>` 不满足