fix print.xgb.DMatrix doc

This commit is contained in:
Vadim Khotilovich 2016-03-27 19:42:26 -05:00
parent 4b760762f9
commit fb5291271e
3 changed files with 22 additions and 5 deletions

View File

@ -327,11 +327,20 @@ slice.xgb.DMatrix <- function(object, idxset, ...) {
#' Print xgb.DMatrix
#'
#' Print information about an xgb.DMatrix.
#' Currently is would display
#' Print information about xgb.DMatrix.
#' Currently it displays dimensions and presence of info-fields and colnames.
#'
#' @param x an xgb.DMatrix object
#' @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
print.xgb.DMatrix <- function(x, verbose=FALSE, ...) {
cat('xgb.DMatrix dim:', nrow(x), 'x', ncol(x), ' info: ')

View File

@ -12,7 +12,15 @@ print.xgb.DMatrix(x, verbose = FALSE, ...)
\item{verbose}{whether to print colnames (when present)}
}
\description{
Print information about an xgb.DMatrix.
Currently is would display
Print information about xgb.DMatrix.
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)
}

View File

@ -18,7 +18,7 @@ value that represents missing value. Sometime a data use 0 or other extreme valu
}
\description{
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{
data(agaricus.train, package='xgboost')