From e8a69013e6e0310b9d8808f61a30ff4e1ddecc5d Mon Sep 17 00:00:00 2001 From: Krzysztof Dyba <35004826+kadyb@users.noreply.github.com> Date: Wed, 8 Mar 2023 22:58:39 +0100 Subject: [PATCH] [R] update `predict` docs (#8886) --- R-package/R/xgb.Booster.R | 4 ++++ R-package/man/predict.xgb.Booster.Rd | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/R-package/R/xgb.Booster.R b/R-package/R/xgb.Booster.R index 6fa07c27f..080067039 100644 --- a/R-package/R/xgb.Booster.R +++ b/R-package/R/xgb.Booster.R @@ -214,6 +214,10 @@ xgb.Booster.complete <- function(object, saveraw = TRUE) { #' Since it quadratically depends on the number of features, it is recommended to perform selection #' of the most important features first. See below about the format of the returned results. #' +#' The \code{predict()} method uses as many threads as defined in \code{xgb.Booster} object (all by default). +#' If you want to change their number, then assign a new number to \code{nthread} using \code{\link{xgb.parameters<-}}. +#' Note also that converting a matrix to \code{\link{xgb.DMatrix}} uses multiple threads too. +#' #' @return #' The return type is different depending whether \code{strict_shape} is set to \code{TRUE}. By default, #' for regression or binary classification, it returns a vector of length \code{nrows(newdata)}. diff --git a/R-package/man/predict.xgb.Booster.Rd b/R-package/man/predict.xgb.Booster.Rd index 067cbf207..87f06d451 100644 --- a/R-package/man/predict.xgb.Booster.Rd +++ b/R-package/man/predict.xgb.Booster.Rd @@ -122,6 +122,10 @@ With \code{predinteraction = TRUE}, SHAP values of contributions of interaction are computed. Note that this operation might be rather expensive in terms of compute and memory. Since it quadratically depends on the number of features, it is recommended to perform selection of the most important features first. See below about the format of the returned results. + +The \code{predict()} method uses as many threads as defined in \code{xgb.Booster} object (all by default). +If you want to change their number, then assign a new number to \code{nthread} using \code{\link{xgb.parameters<-}}. +Note also that converting a matrix to \code{\link{xgb.DMatrix}} uses multiple threads too. } \examples{ ## binary classification: