R-callbacks tests + other tests brushup
This commit is contained in:
@@ -9,7 +9,7 @@ dtrain <- xgb.DMatrix(agaricus.train$data, label = agaricus.train$label)
|
||||
dtest <- xgb.DMatrix(agaricus.test$data, label = agaricus.test$label)
|
||||
|
||||
bst <- xgboost(data = dtrain,
|
||||
max.depth = 2,
|
||||
max_depth = 2,
|
||||
eta = 1,
|
||||
nround = 10,
|
||||
nthread = 1,
|
||||
@@ -17,16 +17,14 @@ bst <- xgboost(data = dtrain,
|
||||
objective = "binary:logistic")
|
||||
|
||||
test_that("call is exposed to R", {
|
||||
model_call <- attr(bst, "call")
|
||||
expect_is(model_call, "call")
|
||||
expect_true(!is.null(bst$call))
|
||||
expect_is(bst$call, "call")
|
||||
})
|
||||
|
||||
test_that("params is exposed to R", {
|
||||
model_params <- attr(bst, "params")
|
||||
|
||||
model_params <- bst$params
|
||||
expect_is(model_params, "list")
|
||||
|
||||
expect_equal(model_params$eta, 1)
|
||||
expect_equal(model_params$max.depth, 2)
|
||||
expect_equal(model_params$max_depth, 2)
|
||||
expect_equal(model_params$objective, "binary:logistic")
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user