R/xgb.load.raw.R

Defines functions xgb.load.raw

Documented in xgb.load.raw

#' Load serialised XGBoost model from R's raw vector
#'
#' User can generate raw memory buffer by calling [xgb.save.raw()].
#'
#' @param buffer The buffer returned by [xgb.save.raw()].
#' @export
xgb.load.raw <- function(buffer) {
  cachelist <- list()
  bst <- .Call(XGBoosterCreate_R, cachelist)
  .Call(XGBoosterLoadModelFromRaw_R, xgb.get.handle(bst), buffer)
  return(bst)
}

Try the xgboost package in your browser

Any scripts or data that you put into this service are public.

xgboost documentation built on Dec. 3, 2025, 5:06 p.m.