From 2ca4016a1fdd7b62bd821b34ee7985024f74d1c0 Mon Sep 17 00:00:00 2001 From: pommedeterresautee Date: Mon, 30 Nov 2015 16:21:43 +0100 Subject: [PATCH] fix relative to examples #Rstat --- R-package/R/xgb.importance.R | 3 +-- R-package/R/xgb.plot.deepness.R | 2 +- R-package/R/xgb.plot.tree.R | 3 +-- R-package/man/xgb.importance.Rd | 3 +-- R-package/man/xgb.plot.deepness.Rd | 2 +- R-package/man/xgb.plot.tree.Rd | 3 +-- 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/R-package/R/xgb.importance.R b/R-package/R/xgb.importance.R index d3a5910b4..78fcaf3ac 100644 --- a/R-package/R/xgb.importance.R +++ b/R-package/R/xgb.importance.R @@ -48,9 +48,8 @@ #' # Both dataset are list with two items, a sparse matrix and labels #' # (labels = outcome column which will be learned). #' # 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") #' #' # train$data@@Dimnames[[2]] represents the column names of the sparse matrix. diff --git a/R-package/R/xgb.plot.deepness.R b/R-package/R/xgb.plot.deepness.R index bebb7605a..b6c05f727 100644 --- a/R-package/R/xgb.plot.deepness.R +++ b/R-package/R/xgb.plot.deepness.R @@ -93,7 +93,7 @@ get.paths.to.leaf <- function(dt.tree) { #' @examples #' 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", #' min_child_weight = 50) #' diff --git a/R-package/R/xgb.plot.tree.R b/R-package/R/xgb.plot.tree.R index ea7fabef7..59822ec83 100644 --- a/R-package/R/xgb.plot.tree.R +++ b/R-package/R/xgb.plot.tree.R @@ -33,9 +33,8 @@ #' #Both dataset are list with two items, a sparse matrix and labels #' #(labels = outcome column which will be learned). #' #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") #' #' #agaricus.test$data@@Dimnames[[2]] represents the column names of the sparse matrix. diff --git a/R-package/man/xgb.importance.Rd b/R-package/man/xgb.importance.Rd index 1f8498deb..14604312e 100644 --- a/R-package/man/xgb.importance.Rd +++ b/R-package/man/xgb.importance.Rd @@ -54,9 +54,8 @@ data(agaricus.train, package='xgboost') # Both dataset are list with two items, a sparse matrix and labels # (labels = outcome column which will be learned). # 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") # train$data@Dimnames[[2]] represents the column names of the sparse matrix. diff --git a/R-package/man/xgb.plot.deepness.Rd b/R-package/man/xgb.plot.deepness.Rd index d011a4dc5..6488514dd 100644 --- a/R-package/man/xgb.plot.deepness.Rd +++ b/R-package/man/xgb.plot.deepness.Rd @@ -35,7 +35,7 @@ This function is inspired by this blog post \url{http://aysent.github.io/2015/11 \examples{ 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", min_child_weight = 50) diff --git a/R-package/man/xgb.plot.tree.Rd b/R-package/man/xgb.plot.tree.Rd index 16e80f9ee..164b013c1 100644 --- a/R-package/man/xgb.plot.tree.Rd +++ b/R-package/man/xgb.plot.tree.Rd @@ -43,9 +43,8 @@ data(agaricus.train, package='xgboost') #Both dataset are list with two items, a sparse matrix and labels #(labels = outcome column which will be learned). #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") #agaricus.test$data@Dimnames[[2]] represents the column names of the sparse matrix.