[R] Fix nthread in DMatrix constructor. (#7127)

* Break the R C API for nthread.
This commit is contained in:
Jiaming Yuan
2021-08-03 17:39:25 +08:00
committed by GitHub
parent ba47eda61b
commit 8ee127469f
5 changed files with 18 additions and 11 deletions

View File

@@ -10,7 +10,7 @@ xgboost <- function(data = NULL, label = NULL, missing = NA, weight = NULL,
save_period = NULL, save_name = "xgboost.model",
xgb_model = NULL, callbacks = list(), ...) {
dtrain <- xgb.get.DMatrix(data, label, missing, weight)
dtrain <- xgb.get.DMatrix(data, label, missing, weight, nthread = params$nthread)
watchlist <- list(train = dtrain)