0.6-4 submission (#1935)
This commit is contained in:
@@ -8,6 +8,8 @@ train <- agaricus.train
|
||||
test <- agaricus.test
|
||||
set.seed(1994)
|
||||
|
||||
windows_flag = grepl('Windows', Sys.info()[['sysname']])
|
||||
|
||||
test_that("train and predict binary classification", {
|
||||
nrounds = 2
|
||||
expect_output(
|
||||
@@ -148,18 +150,21 @@ test_that("training continuation works", {
|
||||
bst1 <- xgb.train(param, dtrain, nrounds = 2, watchlist)
|
||||
# continue for two more:
|
||||
bst2 <- xgb.train(param, dtrain, nrounds = 2, watchlist, xgb_model = bst1)
|
||||
expect_equal(bst$raw, bst2$raw)
|
||||
if (!windows_flag)
|
||||
expect_equal(bst$raw, bst2$raw)
|
||||
expect_false(is.null(bst2$evaluation_log))
|
||||
expect_equal(dim(bst2$evaluation_log), c(4, 2))
|
||||
expect_equal(bst2$evaluation_log, bst$evaluation_log)
|
||||
# test continuing from raw model data
|
||||
bst2 <- xgb.train(param, dtrain, nrounds = 2, watchlist, xgb_model = bst1$raw)
|
||||
expect_equal(bst$raw, bst2$raw)
|
||||
if (!windows_flag)
|
||||
expect_equal(bst$raw, bst2$raw)
|
||||
expect_equal(dim(bst2$evaluation_log), c(2, 2))
|
||||
# test continuing from a model in file
|
||||
xgb.save(bst1, "xgboost.model")
|
||||
bst2 <- xgb.train(param, dtrain, nrounds = 2, watchlist, xgb_model = "xgboost.model")
|
||||
expect_equal(bst$raw, bst2$raw)
|
||||
if (!windows_flag)
|
||||
expect_equal(bst$raw, bst2$raw)
|
||||
expect_equal(dim(bst2$evaluation_log), c(2, 2))
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user