From d174a79fbdba0a1ba8b0d829033ad249ac30dfd6 Mon Sep 17 00:00:00 2001 From: hetong Date: Sat, 6 Sep 2014 21:54:12 -0700 Subject: [PATCH 1/2] add doc for agaricus.test --- R-package/R/xgboost.R | 6 +++--- R-package/man/agaricus.train.Rd | 4 +--- R-package/man/xgb.DMatrix.save.Rd | 2 +- R-package/man/xgboost.Rd | 10 +++++++--- 4 files changed, 12 insertions(+), 10 deletions(-) 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) } From ddf715953a69c13b22d1cf736444dfb12198b7a7 Mon Sep 17 00:00:00 2001 From: hetong Date: Sat, 6 Sep 2014 22:03:07 -0700 Subject: [PATCH 2/2] forced add doc for test --- R-package/man/agaricus.test.Rd | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 R-package/man/agaricus.test.Rd diff --git a/R-package/man/agaricus.test.Rd b/R-package/man/agaricus.test.Rd new file mode 100644 index 000000000..3cf87c9f8 --- /dev/null +++ b/R-package/man/agaricus.test.Rd @@ -0,0 +1,31 @@ +% Generated by roxygen2 (4.0.1): do not edit by hand +\docType{data} +\name{agaricus.test} +\alias{agaricus.test} +\title{Test part from Mushroom Data Set} +\format{A list containing a label vector, and a dgCMatrix object with 1611 +rows and 127 variables} +\usage{ +data(agaricus.test) +} +\description{ +This data set is originally from the Mushroom data set, +UCI Machine Learning Repository. +} +\details{ +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 columns. +} +} +\references{ +https://archive.ics.uci.edu/ml/datasets/Mushroom + +Bache, K. & Lichman, M. (2013). UCI Machine Learning Repository +[http://archive.ics.uci.edu/ml]. Irvine, CA: University of California, +School of Information and Computer Science. +} +\keyword{datasets} +