[R] Remove stringi dependency (#6109)
* [R] Fix empty empty tests and a test warnings * [R] Remove stringi dependency (fix #5905) * Fix R lint check * [R] Fix automatic conversion to factor in R < 4.0.0 in xgb.model.dt.tree * Add `R` Makefile variable Co-authored-by: Philip Hyunsu Cho <chohyu01@cs.washington.edu>
This commit is contained in:
@@ -47,7 +47,7 @@ test_that("custom objective with early stop works", {
|
||||
bst <- xgb.train(param, dtrain, 10, watchlist)
|
||||
expect_equal(class(bst), "xgb.Booster")
|
||||
train_log <- bst$evaluation_log$train_error
|
||||
expect_true(all(diff(train_log)) <= 0)
|
||||
expect_true(all(diff(train_log) <= 0))
|
||||
})
|
||||
|
||||
test_that("custom objective using DMatrix attr works", {
|
||||
|
||||
@@ -9,7 +9,8 @@ test_that("train and prediction when gctorture is on", {
|
||||
test <- agaricus.test
|
||||
gctorture(TRUE)
|
||||
bst <- xgboost(data = train$data, label = train$label, max.depth = 2,
|
||||
eta = 1, nthread = 2, nrounds = 2, objective = "binary:logistic")
|
||||
eta = 1, nthread = 2, nrounds = 2, objective = "binary:logistic")
|
||||
pred <- predict(bst, test$data)
|
||||
gctorture(FALSE)
|
||||
expect_length(pred, length(test$label))
|
||||
})
|
||||
|
||||
@@ -335,8 +335,8 @@ test_that("xgb.model.dt.tree and xgb.importance work with a single split model",
|
||||
})
|
||||
|
||||
test_that("xgb.plot.tree works with and without feature names", {
|
||||
xgb.plot.tree(feature_names = feature.names, model = bst.Tree)
|
||||
xgb.plot.tree(model = bst.Tree)
|
||||
expect_silent(xgb.plot.tree(feature_names = feature.names, model = bst.Tree))
|
||||
expect_silent(xgb.plot.tree(model = bst.Tree))
|
||||
})
|
||||
|
||||
test_that("xgb.plot.multi.trees works with and without feature names", {
|
||||
@@ -390,8 +390,8 @@ test_that("xgb.plot.shap works", {
|
||||
})
|
||||
|
||||
test_that("xgb.plot.shap.summary works", {
|
||||
xgb.plot.shap.summary(data = sparse_matrix, model = bst.Tree, top_n = 2)
|
||||
xgb.ggplot.shap.summary(data = sparse_matrix, model = bst.Tree, top_n = 2)
|
||||
expect_silent(xgb.plot.shap.summary(data = sparse_matrix, model = bst.Tree, top_n = 2))
|
||||
expect_silent(xgb.ggplot.shap.summary(data = sparse_matrix, model = bst.Tree, top_n = 2))
|
||||
})
|
||||
|
||||
test_that("check.deprecation works", {
|
||||
|
||||
Reference in New Issue
Block a user