[R] rename proxy dmatrix -> data batch (#10016)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
% Generated by roxygen2: do not edit by hand
|
||||
% Please edit documentation in R/xgb.DMatrix.R
|
||||
\name{xgb.ProxyDMatrix}
|
||||
\alias{xgb.ProxyDMatrix}
|
||||
\title{Proxy DMatrix Updater}
|
||||
\name{xgb.DataBatch}
|
||||
\alias{xgb.DataBatch}
|
||||
\title{Structure for Data Batches}
|
||||
\usage{
|
||||
xgb.ProxyDMatrix(
|
||||
xgb.DataBatch(
|
||||
data,
|
||||
label = NULL,
|
||||
weight = NULL,
|
||||
@@ -82,7 +82,7 @@ functionalities such as feature importances.}
|
||||
\item{feature_weights}{Set feature weights for column sampling.}
|
||||
}
|
||||
\value{
|
||||
An object of class \code{xgb.ProxyDMatrix}, which is just a list containing the
|
||||
An object of class \code{xgb.DataBatch}, which is just a list containing the
|
||||
data and parameters passed here. It does \bold{not} inherit from \code{xgb.DMatrix}.
|
||||
}
|
||||
\description{
|
||||
@@ -95,8 +95,8 @@ is passed as argument to function \link{xgb.DataIter} to construct a data iterat
|
||||
when constructing a DMatrix through external memory - otherwise, one should call
|
||||
\link{xgb.DMatrix} or \link{xgb.QuantileDMatrix}.
|
||||
|
||||
The object that results from calling this function directly is \bold{not} like the other
|
||||
\code{xgb.DMatrix} variants - i.e. cannot be used to train a model, nor to get predictions - only
|
||||
The object that results from calling this function directly is \bold{not} like
|
||||
an \code{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 \link{xgb.ExternalDMatrix}.
|
||||
@@ -15,12 +15,12 @@ to know which part of the data to pass next.}
|
||||
|
||||
\item{f_next}{\verb{function(env)} which is responsible for:\itemize{
|
||||
\item Accessing or retrieving the next batch of data in the iterator.
|
||||
\item Supplying this data by calling function \link{xgb.ProxyDMatrix} on it and returning the result.
|
||||
\item Supplying this data by calling function \link{xgb.DataBatch} on it and returning the result.
|
||||
\item Keeping track of where in the iterator batch it is or will go next, which can for example
|
||||
be done by modifiying variables in the \code{env} variable that is passed here.
|
||||
\item Signaling whether there are more batches to be consumed or not, by returning \code{NULL}
|
||||
when the stream of data ends (all batches in the iterator have been consumed), or the result from
|
||||
calling \link{xgb.ProxyDMatrix} when there are more batches in the line to be consumed.
|
||||
calling \link{xgb.DataBatch} when there are more batches in the line to be consumed.
|
||||
}}
|
||||
|
||||
\item{f_reset}{\verb{function(env)} which is responsible for reseting the data iterator
|
||||
@@ -47,5 +47,5 @@ which will consume the data and create a DMatrix from it by executing the callba
|
||||
For more information, and for a usage example, see the documentation for \link{xgb.ExternalDMatrix}.
|
||||
}
|
||||
\seealso{
|
||||
\link{xgb.ExternalDMatrix}, \link{xgb.ProxyDMatrix}.
|
||||
\link{xgb.ExternalDMatrix}, \link{xgb.DataBatch}.
|
||||
}
|
||||
|
||||
@@ -87,10 +87,10 @@ iterator_next <- function(iterator_env) {
|
||||
iterator_env[["iter"]] <- curr_iter + 1
|
||||
})
|
||||
|
||||
# Function 'xgb.ProxyDMatrix' must be called manually
|
||||
# Function 'xgb.DataBatch' must be called manually
|
||||
# at each batch with all the appropriate attributes,
|
||||
# such as feature names and feature types.
|
||||
return(xgb.ProxyDMatrix(data = x_batch, label = y_batch))
|
||||
return(xgb.DataBatch(data = x_batch, label = y_batch))
|
||||
}
|
||||
|
||||
# This moves the iterator back to its beginning
|
||||
@@ -118,5 +118,5 @@ pred_dm <- predict(model, dm)
|
||||
pred_mat <- predict(model, as.matrix(mtcars[, -1]))
|
||||
}
|
||||
\seealso{
|
||||
\link{xgb.DataIter}, \link{xgb.ProxyDMatrix}, \link{xgb.QuantileDMatrix.from_iterator}
|
||||
\link{xgb.DataIter}, \link{xgb.DataBatch}, \link{xgb.QuantileDMatrix.from_iterator}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,6 @@ For more information, see the guide 'Using XGBoost External Memory Version':
|
||||
\url{https://xgboost.readthedocs.io/en/stable/tutorials/external_memory.html}
|
||||
}
|
||||
\seealso{
|
||||
\link{xgb.DataIter}, \link{xgb.ProxyDMatrix}, \link{xgb.ExternalDMatrix},
|
||||
\link{xgb.DataIter}, \link{xgb.DataBatch}, \link{xgb.ExternalDMatrix},
|
||||
\link{xgb.QuantileDMatrix}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user