[R] adopt demos and vignettes to a more consistent parameter style
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user