[doc] Clarify the effect of enable_categorical (#9877)
This commit is contained in:
parent
d530d37707
commit
42173d7bc3
@ -27,14 +27,24 @@
|
|||||||
#' @param label_lower_bound Lower bound for survival training.
|
#' @param label_lower_bound Lower bound for survival training.
|
||||||
#' @param label_upper_bound Upper bound for survival training.
|
#' @param label_upper_bound Upper bound for survival training.
|
||||||
#' @param feature_weights Set feature weights for column sampling.
|
#' @param feature_weights Set feature weights for column sampling.
|
||||||
|
#' @param enable_categorical Experimental support of specializing for categorical features.
|
||||||
|
#'
|
||||||
|
#' If passing 'TRUE' and 'data' is a data frame,
|
||||||
|
#' columns of categorical types will automatically
|
||||||
|
#' be set to be of categorical type (feature_type='c') in the resulting DMatrix.
|
||||||
|
#'
|
||||||
|
#' If passing 'FALSE' and 'data' is a data frame with categorical columns,
|
||||||
|
#' it will result in an error being thrown.
|
||||||
|
#'
|
||||||
|
#' If 'data' is not a data frame, this argument is ignored.
|
||||||
|
#'
|
||||||
|
#' JSON/UBJSON serialization format is required for this.
|
||||||
#'
|
#'
|
||||||
#' @details
|
#' @details
|
||||||
#' Note that DMatrix objects are not serializable through R functions such as \code{saveRDS} or \code{save}.
|
#' Note that DMatrix objects are not serializable through R functions such as \code{saveRDS} or \code{save}.
|
||||||
#' If a DMatrix gets serialized and then de-serialized (for example, when saving data in an R session or caching
|
#' If a DMatrix gets serialized and then de-serialized (for example, when saving data in an R session or caching
|
||||||
#' chunks in an Rmd file), the resulting object will not be usable anymore and will need to be reconstructed
|
#' chunks in an Rmd file), the resulting object will not be usable anymore and will need to be reconstructed
|
||||||
#' from the original source of data.
|
#' from the original source of data.
|
||||||
#' @param enable_categorical Experimental support of specializing for
|
|
||||||
#' categorical features. JSON/UBJSON serialization format is required.
|
|
||||||
#'
|
#'
|
||||||
#' @examples
|
#' @examples
|
||||||
#' data(agaricus.train, package='xgboost')
|
#' data(agaricus.train, package='xgboost')
|
||||||
|
|||||||
@ -58,8 +58,18 @@ frame and matrix.}
|
|||||||
|
|
||||||
\item{feature_weights}{Set feature weights for column sampling.}
|
\item{feature_weights}{Set feature weights for column sampling.}
|
||||||
|
|
||||||
\item{enable_categorical}{Experimental support of specializing for
|
\item{enable_categorical}{Experimental support of specializing for categorical features.
|
||||||
categorical features. JSON/UBJSON serialization format is required.}
|
|
||||||
|
If passing 'TRUE' and 'data' is a data frame,
|
||||||
|
columns of categorical types will automatically
|
||||||
|
be set to be of categorical type (feature_type='c') in the resulting DMatrix.
|
||||||
|
|
||||||
|
If passing 'FALSE' and 'data' is a data frame with categorical columns,
|
||||||
|
it will result in an error being thrown.
|
||||||
|
|
||||||
|
If 'data' is not a data frame, this argument is ignored.
|
||||||
|
|
||||||
|
JSON/UBJSON serialization format is required for this.}
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Construct xgb.DMatrix object from either a dense matrix, a sparse matrix, or a local file.
|
Construct xgb.DMatrix object from either a dense matrix, a sparse matrix, or a local file.
|
||||||
|
|||||||
@ -822,8 +822,18 @@ class DMatrix: # pylint: disable=too-many-instance-attributes,too-many-public-m
|
|||||||
|
|
||||||
.. note:: This parameter is experimental
|
.. note:: This parameter is experimental
|
||||||
|
|
||||||
Experimental support of specializing for categorical features. JSON/UBJSON
|
Experimental support of specializing for categorical features.
|
||||||
serialization format is required.
|
|
||||||
|
If passing 'True' and 'data' is a data frame (from supported libraries
|
||||||
|
such as Pandas or Modin), columns of categorical types will automatically
|
||||||
|
be set to be of categorical type (feature_type='c') in the resulting DMatrix.
|
||||||
|
|
||||||
|
If passing 'False' and 'data' is a data frame with categorical columns,
|
||||||
|
it will result in an error being thrown.
|
||||||
|
|
||||||
|
If 'data' is not a data frame, this argument is ignored.
|
||||||
|
|
||||||
|
JSON/UBJSON serialization format is required for this.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if group is not None and qid is not None:
|
if group is not None and qid is not None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user