【发布时间】:2020-03-14 19:34:17
【问题描述】:
在尝试应用包含在 R 中 xgboost 包中并在用户手册中介绍的 xgb.create.features(model, data, ...) 函数时,我遇到了一个我不明白的异常。这是一个可重现的示例:
library(xgboost)
data(mtcars)
X = as.matrix(mtcars[, -9])
Y = mtcars$am
dtrain = xgb.DMatrix(data = X, label = Y)
model = xgb.train(data = dtrain,
feval = performance_fun_F,
verbose =0, maximize = TRUE,
params = list(objective = "binary:logistic",
eta = 0.1,
max_depth = 6,
subsample = 0.8,
lambda = 0.1 ),
nrounds = 10)
dtrain1 = xgb.create.features(model, dtrain)
Error: not-yet-implemented method for cbind2(<xgb.DMatrix>, <dgCMatrix>).
->> Ask the package authors to implement the missing feature.
Traceback:
1. xgb.create.features(model, dtrain)
2. cBind(data, sparse.model.matrix(~. - 1, cols))
3. base::cbind(..., deparse.level = deparse.level)
4. cbind(deparse.level, ...)
5. cbind2(..1, r)
6. cbind2(..1, r)
7. .bail.out.2(.Generic, class(x), class(y))
8. stop(gettextf("not-yet-implemented method for %s(<%s>, <%s>).\n ->> Ask the package authors to implement the missing feature.",
. fun, cl1[1L], cl2[1L]), call. = FALSE, domain = NA)
【问题讨论】:
-
什么是
performance_fun_F?