| xgb.DataBatch | R Documentation |
Helper function to supply data in batches of a data iterator when
constructing a DMatrix from external memory through xgb.ExtMemDMatrix()
or through xgb.QuantileDMatrix.from_iterator().
This function is only meant to be called inside of a callback function (which
is passed as argument to function xgb.DataIter() to construct a data iterator)
when constructing a DMatrix through external memory - otherwise, one should call
xgb.DMatrix() or xgb.QuantileDMatrix().
The object that results from calling this function directly is not like
an xgb.DMatrix - i.e. cannot be used to train a model, nor to get predictions - only
possible usage is to supply data to an iterator, from which a DMatrix is then constructed.
For more information and for example usage, see the documentation for xgb.ExtMemDMatrix().
xgb.DataBatch(
data,
label = NULL,
weight = NULL,
base_margin = NULL,
feature_names = colnames(data),
feature_types = NULL,
group = NULL,
qid = NULL,
label_lower_bound = NULL,
label_upper_bound = NULL,
feature_weights = NULL
)
data |
Batch of data belonging to this batch. Note that not all of the input types supported by
|
label |
Label of the training data. For classification problems, should be passed encoded as integers with numeration starting at zero. |
weight |
Weight for each instance. Note that, for ranking task, weights are per-group. In ranking task, one weight is assigned to each group (not each data point). This is because we only care about the relative ordering of data points within each group, so it doesn't make sense to assign weights to individual data points. |
base_margin |
Base margin used for boosting from existing model. In the case of multi-output models, one can also pass multi-dimensional base_margin. |
feature_names |
Set names for features. Overrides column names in data frame and matrix. Note: columns are not referenced by name when calling |
feature_types |
Set types for features. If Otherwise, one can pass a character vector with the same length as number of columns in
Note that, while categorical types are treated differently from the rest for model fitting purposes, the other types do not influence the generated model, but have effects in other functionalities such as feature importances. Important: Categorical features, if specified manually through |
group |
Group size for all ranking group. |
qid |
Query ID for data samples, used for ranking. |
label_lower_bound |
Lower bound for survival training. |
label_upper_bound |
Upper bound for survival training. |
feature_weights |
Set feature weights for column sampling. |
An object of class xgb.DataBatch, which is just a list containing the
data and parameters passed here. It does not inherit from xgb.DMatrix.
xgb.DataIter(), xgb.ExtMemDMatrix().
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.