Enable parameter validation for R. (#5569)

* Enable parameter validation for R.

* Add test.
This commit is contained in:
Jiaming Yuan
2020-04-22 02:19:09 +08:00
committed by GitHub
parent 564b22cee5
commit c355ab65ed
4 changed files with 43 additions and 8 deletions

View File

@@ -40,7 +40,7 @@ test_that("gblinear works", {
expect_lt(bst$evaluation_log$eval_error[2], ERR_UL)
bst <- xgb.train(param, dtrain, n, watchlist, verbose = VERB, feature_selector = 'thrifty',
top_n = 50, callbacks = list(cb.gblinear.history(sparse = TRUE)))
top_k = 50, callbacks = list(cb.gblinear.history(sparse = TRUE)))
expect_lt(bst$evaluation_log$eval_error[n], ERR_UL)
h <- xgb.gblinear.history(bst)
expect_equal(dim(h), c(n, ncol(dtrain) + 1))