Skip to content

Commit

Permalink
make distinction between matrices and arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
david-cortes committed Dec 3, 2024
1 parent 941d7b9 commit ba2a7a5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions R-package/R/xgboost.R
Original file line number Diff line number Diff line change
Expand Up @@ -996,16 +996,16 @@ xgboost <- function(
#' the baseline).
#'
#' Output will be a numeric matrix with shape `[nrows, nfeatures+1]`, with the intercept being the
#' last feature, or `[nrows, nscores, nfeatures+1]` if the model produces more than one score per
#' observation.
#' last feature, or a numeric array with shape `[nrows, nscores, nfeatures+1]` if the model
#' produces more than one score per observation.
#' - `"interaction"`: similar to `"contrib"`, but computing SHAP values of contributions of
#' interaction of each pair of features. 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.
#'
#' Output will be a numeric matrix of shape `[nrows, nfeatures+1, nfeatures+1]`, or shape
#' Output will be a numeric array of shape `[nrows, nfeatures+1, nfeatures+1]`, or shape
#' `[nrows, nscores, nfeatures+1, nfeatures+1]` (for objectives that produce more than one score
#' per observation).
#' @param base_margin Base margin used for boosting from existing model (raw score that gets added to
Expand Down Expand Up @@ -1039,8 +1039,9 @@ xgboost <- function(
#' Note that this check might add some sizable latency to the predictions, so it's
#' recommended to disable it for performance-sensitive applications.
#' @param ... Not used.
#' @return Either a numeric vector, numeric matrix, or `factor` (see `type` for details about what
#' the output type and shape will be).
#' @return Either a numeric vector (for 1D outputs), numeric matrix (for 2D outputs), numeric array
#' (for 3D and higher), or `factor` (see `type` for details about what the output type and shape
#' will be).
#' @method predict xgboost
#' @export
#' @examples
Expand Down
11 changes: 6 additions & 5 deletions R-package/man/predict.xgboost.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ba2a7a5

Please sign in to comment.