predict.xgb.Booster.prmdt: predict.xgb.Booster

View source: R/predict.R

predict.xgb.Booster.prmdtR Documentation

predict.xgb.Booster

Description

Return prediction for a xgb.train model.

Usage

## S3 method for class 'xgb.Booster.prmdt'
predict(
  object,
  newdata,
  type = "class",
  missing = NA,
  outputmargin = FALSE,
  ntreelimit = NULL,
  predleaf = FALSE,
  predcontrib = FALSE,
  approxcontrib = FALSE,
  predinteraction = FALSE,
  reshape = FALSE,
  ...
)

Arguments

object

a xgb.train model object for which prediction is desired.

newdata

an optional data frame in which to look for variables with which to predict.

type

type of prediction 'prob' or 'class' (default).

missing

Missing is only used when input is dense matrix. Pick a float value that represents missing values in data (e.g., sometimes 0 or some other extreme value is used).

outputmargin

whether the prediction should be returned in the for of original untransformed sum of predictions from boosting iterations' results. E.g., setting outputmargin=TRUE for logistic regression would result in predictions for log-odds instead of probabilities.

ntreelimit

Deprecated, use iterationrange instead.

predleaf

whether predict leaf index.

predcontrib

whether to return feature contributions to individual predictions (see Details).

approxcontrib

whether to use a fast approximation for feature contributions (see Details).

predinteraction

whether to return contributions of feature interactions to individual predictions (see Details).

reshape

whether to reshape the vector of predictions to a matrix form when there are several prediction outputs per case. This option has no effect when either of predleaf, predcontrib, or predinteraction flags is TRUE.

...

additional arguments affecting the predictions produced.

Value

a vector or matrix of predictions for xgb model.


PROMiDAT/trainR documentation built on Sept. 13, 2022, 7:26 a.m.