[R] remove default values in internal booster manipulation functions (#9461)

This commit is contained in:
James Lamb
2023-08-11 02:07:18 -05:00
committed by GitHub
parent d638535581
commit 428f6cbbe2
5 changed files with 32 additions and 13 deletions

View File

@@ -35,7 +35,12 @@ xgb.load <- function(modelfile) {
if (is.null(modelfile))
stop("xgb.load: modelfile cannot be NULL")
handle <- xgb.Booster.handle(modelfile = modelfile)
handle <- xgb.Booster.handle(
params = list(),
cachelist = list(),
modelfile = modelfile,
handle = NULL
)
# re-use modelfile if it is raw so we do not need to serialize
if (typeof(modelfile) == "raw") {
warning(
@@ -45,9 +50,9 @@ xgb.load <- function(modelfile) {
" `xgb.unserialize` instead. "
)
)
bst <- xgb.handleToBooster(handle, modelfile)
bst <- xgb.handleToBooster(handle = handle, raw = modelfile)
} else {
bst <- xgb.handleToBooster(handle, NULL)
bst <- xgb.handleToBooster(handle = handle, raw = NULL)
}
bst <- xgb.Booster.complete(bst, saveraw = TRUE)
return(bst)