【发布时间】:2016-06-24 08:58:28
【问题描述】:
我正在 R 中使用 xgboost 进行交叉验证。
library(xgboost)
data(agaricus.train, package='xgboost')
data(agaricus.test, package='xgboost')
train <- agaricus.train
test <- agaricus.test
cv.res <- xgb.cv(data = train$data, label = train$label, nfold = 5,
nrounds = 2, objective = "binary:logistic")
输出如下
[0] train-error:0.000921+0.000343 test-error:0.001228+0.000687
[1] train-error:0.001075+0.000172 test-error:0.001228+0.000687
我假设误差只是执行回归时所有 k 折和执行分类时模式之间的误差平均值,对吗?加号后面的第二个词是什么?
在回归中,当计算 k 折之间的平均值时,是否考虑到每个折的权重相等,或者在某些情况下它会为特定折赋予更多权重?
【问题讨论】: