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.