Debian Codegraph @

man/xgb.cb.cv.predict.Rd

raw
1 % Generated by roxygen2: do not edit by hand
2 % Please edit documentation in R/callbacks.R
3 \name{xgb.cb.cv.predict}
4 \alias{xgb.cb.cv.predict}
5 \title{Callback for returning cross-validation based predictions}
6 \usage{
7 xgb.cb.cv.predict(save_models = FALSE, outputmargin = FALSE)
8 }
9 \arguments{
10 \item{save_models}{A flag for whether to save the folds' models.}
11
12 \item{outputmargin}{Whether to save margin predictions (same effect as passing this
13 parameter to \link{predict.xgb.Booster}).}
14 }
15 \value{
16 An \code{xgb.Callback} object, which can be passed to \code{\link[=xgb.cv]{xgb.cv()}},
17 but \strong{not} to \code{\link[=xgb.train]{xgb.train()}}.
18 }
19 \description{
20 This callback function saves predictions for all of the test folds,
21 and also allows to save the folds' models.
22 }
23 \details{
24 Predictions are saved inside of the \code{pred} element, which is either a vector or a matrix,
25 depending on the number of prediction outputs per data row. The order of predictions corresponds
26 to the order of rows in the original dataset. Note that when a custom \code{folds} list is
27 provided in \code{\link[=xgb.cv]{xgb.cv()}}, the predictions would only be returned properly when this list is a
28 non-overlapping list of k sets of indices, as in a standard k-fold CV. The predictions would not be
29 meaningful when user-provided folds have overlapping indices as in, e.g., random sampling splits.
30 When some of the indices in the training dataset are not included into user-provided \code{folds},
31 their prediction value would be \code{NA}.
32 }