[R] adopt demos and vignettes to a more consistent parameter style

This commit is contained in:
Vadim Khotilovich
2016-06-27 02:00:39 -05:00
parent a0aa305268
commit 3b6b344561
11 changed files with 59 additions and 59 deletions

View File

@@ -84,8 +84,8 @@ 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")
bst <- xgboost(data = train$data, label = train$label, max_depth = 2, eta = 1,
nrounds = 2, objective = "binary:logistic")
xgb.save(bst, 'model.save')
bst = xgb.load('model.save')
pred <- predict(bst, test$data)
@@ -162,9 +162,9 @@ evalerror <- function(preds, dtrain) {
dtest <- xgb.DMatrix(test$data, label = test$label)
watchlist <- list(eval = dtest, train = dtrain)
param <- list(max.depth = 2, eta = 1, silent = 1)
param <- list(max_depth = 2, eta = 1, silent = 1)
bst <- xgb.train(param, dtrain, nround = 2, watchlist, logregobj, evalerror)
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist, logregobj, evalerror)
@
The gradient and second order gradient is required for the output of customized