diff --git a/R-package/R/xgboost.R b/R-package/R/xgboost.R index bf8cd96a6..9426c0b26 100644 --- a/R-package/R/xgboost.R +++ b/R-package/R/xgboost.R @@ -69,10 +69,10 @@ xgboost <- function(data = NULL, label = NULL, params = list(), nrounds, #' #' \itemize{ #' \item \code{label} the label for each record -#' \item \code{data} a sparse Matrix of \code{dgCMatrix} class, with 127 rows. +#' \item \code{data} a sparse Matrix of \code{dgCMatrix} class, with 127 columns. #' } #' -#'#' @references +#' @references #' https://archive.ics.uci.edu/ml/datasets/Mushroom #' #' Bache, K. & Lichman, M. (2013). UCI Machine Learning Repository @@ -96,7 +96,7 @@ NULL #' #' \itemize{ #' \item \code{label} the label for each record -#' \item \code{data} a sparse Matrix of \code{dgCMatrix} class, with 127 rows. +#' \item \code{data} a sparse Matrix of \code{dgCMatrix} class, with 127 columns. #' } #' #' @references diff --git a/R-package/man/agaricus.train.Rd b/R-package/man/agaricus.train.Rd index d1a401ecd..dd9f6e9a3 100644 --- a/R-package/man/agaricus.train.Rd +++ b/R-package/man/agaricus.train.Rd @@ -17,10 +17,8 @@ This data set includes the following fields: \itemize{ \item \code{label} the label for each record - \item \code{data} a sparse Matrix of \code{dgCMatrix} class, with 127 rows. + \item \code{data} a sparse Matrix of \code{dgCMatrix} class, with 127 columns. } - -#' } \references{ https://archive.ics.uci.edu/ml/datasets/Mushroom diff --git a/R-package/man/xgb.DMatrix.save.Rd b/R-package/man/xgb.DMatrix.save.Rd index 2692069dc..139db8548 100644 --- a/R-package/man/xgb.DMatrix.save.Rd +++ b/R-package/man/xgb.DMatrix.save.Rd @@ -6,7 +6,7 @@ xgb.DMatrix.save(DMatrix, fname) } \arguments{ -\item{DMatrix}{the model object.} +\item{DMatrix}{the DMatrix object} \item{fname}{the name of the binary file.} } diff --git a/R-package/man/xgboost.Rd b/R-package/man/xgboost.Rd index 435423d28..95c3374fc 100644 --- a/R-package/man/xgboost.Rd +++ b/R-package/man/xgboost.Rd @@ -45,8 +45,12 @@ Parallelization is automatically enabled if OpenMP is present. Number of threads can also be manually specified via "nthread" parameter } \examples{ -data(iris) -bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]=='setosa'), nrounds = 2) -pred <- predict(bst, as.matrix(iris[,1:4])) +data(agaricus.train, package='xgboost') +data(agaricus.test, package='xgboost') +train <- agaricus.train +test <- agaricus.test +bst <- xgboost(data = train$data, label = train$label, max.depth = 2, + eta = 1, nround = 2,objective = "binary:logistic") +pred <- predict(bst, test$data) }