警告是什么;NA用作学习者参数缺失的默认值;在mlr中是什么意思?
我正在通过mlr包运行分类xgboost。我的数据中有缺失值,我希望保留这些值(也就是说,我希望保留这些观察值,并且我希望避免插补)。我知道mlr中的xgboost实现可以处理缺少的值。但是,我不理解mlr的makeLearner函数提供的警告 我曾尝试阅读文档,并在其他人的代码中发现此警告。但我还没有看到以一种对我有意义的方式提出的警告 例如,我已经阅读了这篇关于警告的讨论,但它没有为我澄清一些事情: 调用makeLearner函数时出现警告:警告是什么;NA用作学习者参数缺失的默认值;在mlr中是什么意思?,r,xgboost,mlr,R,Xgboost,Mlr,我正在通过mlr包运行分类xgboost。我的数据中有缺失值,我希望保留这些值(也就是说,我希望保留这些观察值,并且我希望避免插补)。我知道mlr中的xgboost实现可以处理缺少的值。但是,我不理解mlr的makeLearner函数提供的警告 我曾尝试阅读文档,并在其他人的代码中发现此警告。但我还没有看到以一种对我有意义的方式提出的警告 例如,我已经阅读了这篇关于警告的讨论,但它没有为我澄清一些事情: 调用makeLearner函数时出现警告: xgb_learner <- makeL
xgb_learner <- makeLearner(
"classif.xgboost",
predict.type = "prob",
par.vals = list(
objective = "binary:logistic",
eval_metric = "error",
nrounds = 200,
missing = NA,
max_depth = 6,
eta = 0.1,
gamma = 5,
colsample_bytree = 0.5,
min_child_weight = 1,
subsample = 0.7
)
)
Warning in makeParam(id = id, type = "numeric", learner.param = TRUE, lower = lower, :
NA used as a default value for learner parameter missing.
ParamHelpers uses NA as a special value for dependent parameters.
从getParamSet函数中,似乎缺少的参数从-Inf到Inf取数值。因此,NA可能不是有效值
> getParamSet("classif.xgboost")
Warning in makeParam(id = id, type = "numeric", learner.param = TRUE, lower = lower, :
NA used as a default value for learner parameter missing.
ParamHelpers uses NA as a special value for dependent parameters.
Type len Def Constr Req Tunable Trafo
booster discrete - gbtree gbtree,gblinear,dart - TRUE -
watchlist untyped - <NULL> - - FALSE -
eta numeric - 0.3 0 to 1 - TRUE -
gamma numeric - 0 0 to Inf - TRUE -
max_depth integer - 6 1 to Inf - TRUE -
min_child_weight numeric - 1 0 to Inf - TRUE -
subsample numeric - 1 0 to 1 - TRUE -
colsample_bytree numeric - 1 0 to 1 - TRUE -
colsample_bylevel numeric - 1 0 to 1 - TRUE -
num_parallel_tree integer - 1 1 to Inf - TRUE -
lambda numeric - 1 0 to Inf - TRUE -
lambda_bias numeric - 0 0 to Inf - TRUE -
alpha numeric - 0 0 to Inf - TRUE -
objective untyped - binary:logistic - - FALSE -
eval_metric untyped - error - - FALSE -
base_score numeric - 0.5 -Inf to Inf - FALSE -
max_delta_step numeric - 0 0 to Inf - TRUE -
missing numeric - -Inf to Inf - FALSE -
getParamSet(“classif.xgboost”)
makeParam中的警告(id=id,type=“numeric”,learner.param=TRUE,lower=lower,:
NA用作缺少学习者参数的默认值。
ParamHelpers使用NA作为依赖参数的特殊值。
类型len Def Constr Req可调交通
助推器离散-gbtree gbtree,gblinear,dart-真-
监视列表未类型化---FALSE-
eta数值-0.3 0到1-正确-
伽马数值-0到Inf-TRUE-
最大深度整数-6 1到Inf-TRUE-
最小子项权重数值-10到Inf-TRUE-
子样本数字-1 0到1-真-
colsample_bytree numeric-1 0到1-TRUE-
colsample_bylevel numeric-1 0到1-TRUE-
num_parallel_树整数-1到Inf-TRUE-
lambda numeric-1 0到Inf-TRUE-
lambda_偏差数值-0到Inf-TRUE-
字母数字-0到Inf-TRUE-
目标非分型-二元:逻辑-假-
评估度量未类型化-错误--错误-
基本分数数字-0.5-Inf到Inf-FALSE-
最大增量步长数值-0到Inf-TRUE-
缺少数字--Inf到Inf-错误-
我是否需要将它们重新编码为一个特定的值,然后传递给mlr(通过makeLearner中的missing=[specific value])?执行其他操作?或者这条警告不值得担心吗
非常感谢您的澄清。此警告来自ParamHelpers,在这种情况下是无害的。这是一个标准检查,不考虑特定情况。您介意详细说明它试图告诉我什么吗?在什么情况下会引起关注?在许多情况下,NA可能不是一个合理的默认值,但just之所以添加,是因为代码的作者不太清楚。这里不是这样。即使这样,你也可以争论是否真的需要检查。也许是
ParamHelpers
处理xgboost
的缺少的参数的方法,默认情况下是NA
。我试图为它设置另一个值,但战争失败了宁仍然在那里。
> getParamSet("classif.xgboost")
Warning in makeParam(id = id, type = "numeric", learner.param = TRUE, lower = lower, :
NA used as a default value for learner parameter missing.
ParamHelpers uses NA as a special value for dependent parameters.
Type len Def Constr Req Tunable Trafo
booster discrete - gbtree gbtree,gblinear,dart - TRUE -
watchlist untyped - <NULL> - - FALSE -
eta numeric - 0.3 0 to 1 - TRUE -
gamma numeric - 0 0 to Inf - TRUE -
max_depth integer - 6 1 to Inf - TRUE -
min_child_weight numeric - 1 0 to Inf - TRUE -
subsample numeric - 1 0 to 1 - TRUE -
colsample_bytree numeric - 1 0 to 1 - TRUE -
colsample_bylevel numeric - 1 0 to 1 - TRUE -
num_parallel_tree integer - 1 1 to Inf - TRUE -
lambda numeric - 1 0 to Inf - TRUE -
lambda_bias numeric - 0 0 to Inf - TRUE -
alpha numeric - 0 0 to Inf - TRUE -
objective untyped - binary:logistic - - FALSE -
eval_metric untyped - error - - FALSE -
base_score numeric - 0.5 -Inf to Inf - FALSE -
max_delta_step numeric - 0 0 to Inf - TRUE -
missing numeric - -Inf to Inf - FALSE -