fix relative to examples #Rstat
This commit is contained in:
parent
730bd72056
commit
2ca4016a1f
@ -48,9 +48,8 @@
|
|||||||
#' # Both dataset are list with two items, a sparse matrix and labels
|
#' # Both dataset are list with two items, a sparse matrix and labels
|
||||||
#' # (labels = outcome column which will be learned).
|
#' # (labels = outcome column which will be learned).
|
||||||
#' # Each column of the sparse Matrix is a feature in one hot encoding format.
|
#' # Each column of the sparse Matrix is a feature in one hot encoding format.
|
||||||
#' train <- agaricus.train
|
|
||||||
#'
|
#'
|
||||||
#' bst <- xgboost(data = train$data, label = train$label, max.depth = 2,
|
#' bst <- xgboost(data = agaricus.train$data, label = agaricus.train$label, max.depth = 2,
|
||||||
#' eta = 1, nthread = 2, nround = 2,objective = "binary:logistic")
|
#' eta = 1, nthread = 2, nround = 2,objective = "binary:logistic")
|
||||||
#'
|
#'
|
||||||
#' # train$data@@Dimnames[[2]] represents the column names of the sparse matrix.
|
#' # train$data@@Dimnames[[2]] represents the column names of the sparse matrix.
|
||||||
|
|||||||
@ -93,7 +93,7 @@ get.paths.to.leaf <- function(dt.tree) {
|
|||||||
#' @examples
|
#' @examples
|
||||||
#' data(agaricus.train, package='xgboost')
|
#' data(agaricus.train, package='xgboost')
|
||||||
#'
|
#'
|
||||||
#' bst <- xgboost(data = agaricus.train$data, max.depth = 15,
|
#' bst <- xgboost(data = agaricus.train$data, label = agaricus.train$label, max.depth = 15,
|
||||||
#' eta = 1, nthread = 2, nround = 30, objective = "binary:logistic",
|
#' eta = 1, nthread = 2, nround = 30, objective = "binary:logistic",
|
||||||
#' min_child_weight = 50)
|
#' min_child_weight = 50)
|
||||||
#'
|
#'
|
||||||
|
|||||||
@ -33,9 +33,8 @@
|
|||||||
#' #Both dataset are list with two items, a sparse matrix and labels
|
#' #Both dataset are list with two items, a sparse matrix and labels
|
||||||
#' #(labels = outcome column which will be learned).
|
#' #(labels = outcome column which will be learned).
|
||||||
#' #Each column of the sparse Matrix is a feature in one hot encoding format.
|
#' #Each column of the sparse Matrix is a feature in one hot encoding format.
|
||||||
#' train <- agaricus.train
|
|
||||||
#'
|
#'
|
||||||
#' bst <- xgboost(data = train$data, label = train$label, max.depth = 2,
|
#' bst <- xgboost(data = agaricus.train$data, label = agaricus.train$label, max.depth = 2,
|
||||||
#' eta = 1, nthread = 2, nround = 2,objective = "binary:logistic")
|
#' eta = 1, nthread = 2, nround = 2,objective = "binary:logistic")
|
||||||
#'
|
#'
|
||||||
#' #agaricus.test$data@@Dimnames[[2]] represents the column names of the sparse matrix.
|
#' #agaricus.test$data@@Dimnames[[2]] represents the column names of the sparse matrix.
|
||||||
|
|||||||
@ -54,9 +54,8 @@ data(agaricus.train, package='xgboost')
|
|||||||
# Both dataset are list with two items, a sparse matrix and labels
|
# Both dataset are list with two items, a sparse matrix and labels
|
||||||
# (labels = outcome column which will be learned).
|
# (labels = outcome column which will be learned).
|
||||||
# Each column of the sparse Matrix is a feature in one hot encoding format.
|
# Each column of the sparse Matrix is a feature in one hot encoding format.
|
||||||
train <- agaricus.train
|
|
||||||
|
|
||||||
bst <- xgboost(data = train$data, label = train$label, max.depth = 2,
|
bst <- xgboost(data = agaricus.train$data, label = agaricus.train$label, max.depth = 2,
|
||||||
eta = 1, nthread = 2, nround = 2,objective = "binary:logistic")
|
eta = 1, nthread = 2, nround = 2,objective = "binary:logistic")
|
||||||
|
|
||||||
# train$data@Dimnames[[2]] represents the column names of the sparse matrix.
|
# train$data@Dimnames[[2]] represents the column names of the sparse matrix.
|
||||||
|
|||||||
@ -35,7 +35,7 @@ This function is inspired by this blog post \url{http://aysent.github.io/2015/11
|
|||||||
\examples{
|
\examples{
|
||||||
data(agaricus.train, package='xgboost')
|
data(agaricus.train, package='xgboost')
|
||||||
|
|
||||||
bst <- xgboost(data = agaricus.train$data, max.depth = 15,
|
bst <- xgboost(data = agaricus.train$data, label = agaricus.train$label, max.depth = 15,
|
||||||
eta = 1, nthread = 2, nround = 30, objective = "binary:logistic",
|
eta = 1, nthread = 2, nround = 30, objective = "binary:logistic",
|
||||||
min_child_weight = 50)
|
min_child_weight = 50)
|
||||||
|
|
||||||
|
|||||||
@ -43,9 +43,8 @@ data(agaricus.train, package='xgboost')
|
|||||||
#Both dataset are list with two items, a sparse matrix and labels
|
#Both dataset are list with two items, a sparse matrix and labels
|
||||||
#(labels = outcome column which will be learned).
|
#(labels = outcome column which will be learned).
|
||||||
#Each column of the sparse Matrix is a feature in one hot encoding format.
|
#Each column of the sparse Matrix is a feature in one hot encoding format.
|
||||||
train <- agaricus.train
|
|
||||||
|
|
||||||
bst <- xgboost(data = train$data, label = train$label, max.depth = 2,
|
bst <- xgboost(data = agaricus.train$data, label = agaricus.train$label, max.depth = 2,
|
||||||
eta = 1, nthread = 2, nround = 2,objective = "binary:logistic")
|
eta = 1, nthread = 2, nround = 2,objective = "binary:logistic")
|
||||||
|
|
||||||
#agaricus.test$data@Dimnames[[2]] represents the column names of the sparse matrix.
|
#agaricus.test$data@Dimnames[[2]] represents the column names of the sparse matrix.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user