add doc for agaricus.test

This commit is contained in:
hetong 2014-09-06 21:54:12 -07:00
parent 43a781f59b
commit d174a79fbd
4 changed files with 12 additions and 10 deletions

View File

@ -69,10 +69,10 @@ xgboost <- function(data = NULL, label = NULL, params = list(), nrounds,
#' #'
#' \itemize{ #' \itemize{
#' \item \code{label} the label for each record #' \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 #' https://archive.ics.uci.edu/ml/datasets/Mushroom
#' #'
#' Bache, K. & Lichman, M. (2013). UCI Machine Learning Repository #' Bache, K. & Lichman, M. (2013). UCI Machine Learning Repository
@ -96,7 +96,7 @@ NULL
#' #'
#' \itemize{ #' \itemize{
#' \item \code{label} the label for each record #' \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

View File

@ -17,10 +17,8 @@ This data set includes the following fields:
\itemize{ \itemize{
\item \code{label} the label for each record \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 https://archive.ics.uci.edu/ml/datasets/Mushroom

View File

@ -6,7 +6,7 @@
xgb.DMatrix.save(DMatrix, fname) xgb.DMatrix.save(DMatrix, fname)
} }
\arguments{ \arguments{
\item{DMatrix}{the model object.} \item{DMatrix}{the DMatrix object}
\item{fname}{the name of the binary file.} \item{fname}{the name of the binary file.}
} }

View File

@ -45,8 +45,12 @@ Parallelization is automatically enabled if OpenMP is present.
Number of threads can also be manually specified via "nthread" parameter Number of threads can also be manually specified via "nthread" parameter
} }
\examples{ \examples{
data(iris) data(agaricus.train, package='xgboost')
bst <- xgboost(as.matrix(iris[,1:4]),as.numeric(iris[,5]=='setosa'), nrounds = 2) data(agaricus.test, package='xgboost')
pred <- predict(bst, as.matrix(iris[,1:4])) 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)
} }