Disable JSON full serialization for now. (#6248)
* Disable JSON serialization for now.
* Multi-class classification is checkpointing for each iteration.
This brings significant overhead.
Revert: 90355b4f00
* Set R tests to use binary.
This commit is contained in:
@@ -175,16 +175,16 @@ test_that("cb.reset.parameters works as expected", {
|
||||
})
|
||||
|
||||
test_that("cb.save.model works as expected", {
|
||||
files <- c('xgboost_01.json', 'xgboost_02.json', 'xgboost.json')
|
||||
files <- c('xgboost_01.bin', 'xgboost_02.bin', 'xgboost.bin')
|
||||
for (f in files) if (file.exists(f)) file.remove(f)
|
||||
|
||||
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist, eta = 1, verbose = 0,
|
||||
save_period = 1, save_name = "xgboost_%02d.json")
|
||||
expect_true(file.exists('xgboost_01.json'))
|
||||
expect_true(file.exists('xgboost_02.json'))
|
||||
b1 <- xgb.load('xgboost_01.json')
|
||||
save_period = 1, save_name = "xgboost_%02d.bin")
|
||||
expect_true(file.exists('xgboost_01.bin'))
|
||||
expect_true(file.exists('xgboost_02.bin'))
|
||||
b1 <- xgb.load('xgboost_01.bin')
|
||||
expect_equal(xgb.ntree(b1), 1)
|
||||
b2 <- xgb.load('xgboost_02.json')
|
||||
b2 <- xgb.load('xgboost_02.bin')
|
||||
expect_equal(xgb.ntree(b2), 2)
|
||||
|
||||
xgb.config(b2) <- xgb.config(bst)
|
||||
@@ -193,9 +193,9 @@ test_that("cb.save.model works as expected", {
|
||||
|
||||
# save_period = 0 saves the last iteration's model
|
||||
bst <- xgb.train(param, dtrain, nrounds = 2, watchlist, eta = 1, verbose = 0,
|
||||
save_period = 0, save_name = 'xgboost.json')
|
||||
expect_true(file.exists('xgboost.json'))
|
||||
b2 <- xgb.load('xgboost.json')
|
||||
save_period = 0, save_name = 'xgboost.bin')
|
||||
expect_true(file.exists('xgboost.bin'))
|
||||
b2 <- xgb.load('xgboost.bin')
|
||||
xgb.config(b2) <- xgb.config(bst)
|
||||
expect_equal(bst$raw, b2$raw)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user