fix print.xgb.DMatrix doc
This commit is contained in:
parent
4b760762f9
commit
fb5291271e
@ -327,11 +327,20 @@ slice.xgb.DMatrix <- function(object, idxset, ...) {
|
|||||||
|
|
||||||
#' Print xgb.DMatrix
|
#' Print xgb.DMatrix
|
||||||
#'
|
#'
|
||||||
#' Print information about an xgb.DMatrix.
|
#' Print information about xgb.DMatrix.
|
||||||
#' Currently is would display
|
#' Currently it displays dimensions and presence of info-fields and colnames.
|
||||||
|
#'
|
||||||
#' @param x an xgb.DMatrix object
|
#' @param x an xgb.DMatrix object
|
||||||
#' @param verbose whether to print colnames (when present)
|
#' @param verbose whether to print colnames (when present)
|
||||||
#'
|
#'
|
||||||
|
#'
|
||||||
|
#' @examples
|
||||||
|
#' data(agaricus.train, package='xgboost')
|
||||||
|
#' train <- agaricus.train
|
||||||
|
#' dtrain <- xgb.DMatrix(train$data, label=train$label)
|
||||||
|
#'
|
||||||
|
#' dtrain
|
||||||
|
#' print(dtrain, verbose=T)
|
||||||
#' @export
|
#' @export
|
||||||
print.xgb.DMatrix <- function(x, verbose=FALSE, ...) {
|
print.xgb.DMatrix <- function(x, verbose=FALSE, ...) {
|
||||||
cat('xgb.DMatrix dim:', nrow(x), 'x', ncol(x), ' info: ')
|
cat('xgb.DMatrix dim:', nrow(x), 'x', ncol(x), ' info: ')
|
||||||
|
|||||||
@ -12,7 +12,15 @@ print.xgb.DMatrix(x, verbose = FALSE, ...)
|
|||||||
\item{verbose}{whether to print colnames (when present)}
|
\item{verbose}{whether to print colnames (when present)}
|
||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Print information about an xgb.DMatrix.
|
Print information about xgb.DMatrix.
|
||||||
Currently is would display
|
Currently it displays dimensions and presence of info-fields and colnames.
|
||||||
|
}
|
||||||
|
\examples{
|
||||||
|
data(agaricus.train, package='xgboost')
|
||||||
|
train <- agaricus.train
|
||||||
|
dtrain <- xgb.DMatrix(train$data, label=train$label)
|
||||||
|
|
||||||
|
dtrain
|
||||||
|
print(dtrain, verbose=T)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -18,7 +18,7 @@ value that represents missing value. Sometime a data use 0 or other extreme valu
|
|||||||
}
|
}
|
||||||
\description{
|
\description{
|
||||||
Contruct xgb.DMatrix object from dense matrix, sparse matrix
|
Contruct xgb.DMatrix object from dense matrix, sparse matrix
|
||||||
or local file (that is a previously saved \code{xgb.DMatrix}).
|
or local file (that was created previously by saving an \code{xgb.DMatrix}).
|
||||||
}
|
}
|
||||||
\examples{
|
\examples{
|
||||||
data(agaricus.train, package='xgboost')
|
data(agaricus.train, package='xgboost')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user