add doc for agaricus.test
This commit is contained in:
parent
43a781f59b
commit
d174a79fbd
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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.}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user