From 8a4e66299af6939996ff63054af93ddd2de9f9c9 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 27 Aug 2014 22:12:30 -0700 Subject: [PATCH] remove default value for nrounds --- R-package/R/xgb.train.R | 2 +- R-package/R/xgboost.R | 2 +- R-package/demo/demo.R | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/R-package/R/xgb.train.R b/R-package/R/xgb.train.R index 19ffc6529..2bdacce49 100644 --- a/R-package/R/xgb.train.R +++ b/R-package/R/xgb.train.R @@ -1,5 +1,5 @@ # train a model using given parameters -xgb.train <- function(params=list(), dtrain, nrounds = 10, watchlist = list(), +xgb.train <- function(params=list(), dtrain, nrounds, watchlist = list(), obj = NULL, feval = NULL, ...) { if (typeof(params) != "list") { stop("xgb.train: first argument params must be list") diff --git a/R-package/R/xgboost.R b/R-package/R/xgboost.R index ba32eed26..c6aaa4f8b 100644 --- a/R-package/R/xgboost.R +++ b/R-package/R/xgboost.R @@ -1,5 +1,5 @@ # Main function for xgboost-package -xgboost <- function(data = NULL, label = NULL, params = list(), nrounds = 10, +xgboost <- function(data = NULL, label = NULL, params = list(), nrounds, verbose = 1, ...) { inClass <- class(data) if (inClass == "dgCMatrix" || inClass == "matrix") { diff --git a/R-package/demo/demo.R b/R-package/demo/demo.R index 45692eec7..b1299a7d1 100644 --- a/R-package/demo/demo.R +++ b/R-package/demo/demo.R @@ -46,27 +46,27 @@ dtrain <- xgb.DMatrix(dense.x, label = y) ############################ Test xgboost with local file, sparse matrix and dense matrix in R. # Test with DMatrix object -bst <- xgboost(data = dtrain, max_depth = 2, eta = 1, +bst <- xgboost(data = dtrain, max_depth = 2, eta = 1, nround = 2, objective = "binary:logistic") # Verbose = 0,1,2 -bst <- xgboost(data = dtrain, max_depth = 2, eta = 1, +bst <- xgboost(data = dtrain, max_depth = 2, eta = 1, nround = 2, objective = "binary:logistic", verbose = 0) -bst <- xgboost(data = dtrain, max_depth = 2, eta = 1, +bst <- xgboost(data = dtrain, max_depth = 2, eta = 1, nround = 2, objective = "binary:logistic", verbose = 1) -bst <- xgboost(data = dtrain, max_depth = 2, eta = 1, +bst <- xgboost(data = dtrain, max_depth = 2, eta = 1, nround = 2, objective = "binary:logistic", verbose = 2) # Test with local file -bst <- xgboost(data = "agaricus.txt.train", max_depth = 2, eta = 1, +bst <- xgboost(data = "agaricus.txt.train", max_depth = 2, eta = 1,nround = 2, objective = "binary:logistic") # Test with Sparse Matrix -bst <- xgboost(data = x, label = y, max_depth = 2, eta = 1, +bst <- xgboost(data = x, label = y, max_depth = 2, eta = 1, nround = 2, objective = "binary:logistic") # Test with dense Matrix -bst <- xgboost(data = dense.x, label = y, max_depth = 2, eta = 1, +bst <- xgboost(data = dense.x, label = y, max_depth = 2, eta = 1, nround = 2, objective = "binary:logistic")