Return prediction for a xgb.train model.
# S3 method for xgb.Booster.prmdt
predict(
object,
newdata,
type = "class",
missing = NA,
outputmargin = FALSE,
ntreelimit = NULL,
predleaf = FALSE,
predcontrib = FALSE,
approxcontrib = FALSE,
predinteraction = FALSE,
reshape = FALSE,
...
)a vector or matrix of predictions for xgb model.
a xgb.train model object for which prediction is desired.
an optional data frame in which to look for variables with which to predict.
type of prediction 'prob' or 'class' (default).
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).
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.
Deprecated, use iterationrange instead.
whether predict leaf index.
whether to return feature contributions to individual predictions (see Details).
whether to use a fast approximation for feature contributions (see Details).
whether to return contributions of feature interactions to individual predictions (see Details).
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.