diff --git a/tests/testthat/test-discretize_xgb.R b/tests/testthat/test-discretize_xgb.R index 4e1ba87..865df14 100644 --- a/tests/testthat/test-discretize_xgb.R +++ b/tests/testthat/test-discretize_xgb.R @@ -108,6 +108,8 @@ sim_tr_reg <- sim_data_reg(1000) sim_te_reg <- sim_data_reg(100) test_that("run_xgboost for classification", { + skip_on_cran() # because data.table uses all cores by default + xgboost <- embed:::run_xgboost( xgb_credit_train, xgb_credit_test, @@ -127,6 +129,8 @@ test_that("run_xgboost for classification", { }) test_that("run_xgboost for multi-classification", { + skip_on_cran() # because data.table uses all cores by default + xgboost <- embed:::run_xgboost( xgb_attrition_train, xgb_attrition_test, @@ -146,6 +150,8 @@ test_that("run_xgboost for multi-classification", { }) test_that("run_xgboost for regression", { + skip_on_cran() # because data.table uses all cores by default + xgboost <- embed:::run_xgboost( xgb_ames_train, xgb_ames_test, @@ -165,6 +171,8 @@ test_that("run_xgboost for regression", { }) test_that("xgb_binning for classification", { + skip_on_cran() # because data.table uses all cores by default + less_than_3.6 <- function() { utils::compareVersion("3.5.3", as.character(getRversion())) >= 0 } @@ -204,6 +212,8 @@ test_that("xgb_binning for classification", { }) test_that("xgb_binning for multi-classification", { + skip_on_cran() # because data.table uses all cores by default + less_than_3.6 <- function() { utils::compareVersion("3.5.3", as.character(getRversion())) >= 0 } @@ -242,6 +252,8 @@ test_that("xgb_binning for multi-classification", { }) test_that("xgb_binning for regression", { + skip_on_cran() # because data.table uses all cores by default + less_than_3.6 <- function() { utils::compareVersion("3.5.3", as.character(getRversion())) >= 0 } @@ -281,6 +293,8 @@ test_that("xgb_binning for regression", { }) test_that("step_discretize_xgb for classification", { + skip_on_cran() # because data.table uses all cores by default + set.seed(125) # General use xgb_rec <- @@ -335,6 +349,8 @@ test_that("step_discretize_xgb for classification", { }) test_that("step_discretize_xgb for multi-classification", { + skip_on_cran() # because data.table uses all cores by default + set.seed(125) # General use xgb_rec <- @@ -386,6 +402,8 @@ test_that("step_discretize_xgb for multi-classification", { }) test_that("step_discretize_xgb for regression", { + skip_on_cran() # because data.table uses all cores by default + # Skip on R < 3.6 since the rng is different. skip("Needs to determine why random numbers are different") @@ -463,6 +481,8 @@ test_that("step_discretize_xgb for regression", { }) test_that("xgb_binning() errors if only one class in outcome", { + skip_on_cran() # because data.table uses all cores by default + const_outcome <- data.frame( outcome = factor(rep("a", 1000)), predictor = rep(1, 1000) @@ -483,6 +503,8 @@ test_that("xgb_binning() errors if only one class in outcome", { }) test_that("case weights step_discretize_xgb", { + skip_on_cran() # because data.table uses all cores by default + sim_tr_cls_cw <- sim_tr_cls %>% mutate(weight = importance_weights(rep(1:0, each = 500))) @@ -661,6 +683,8 @@ test_that("empty selection tidy method works", { }) test_that("printing", { + skip_on_cran() # because data.table uses all cores by default + rec <- recipe(class ~ ., data = sim_tr_cls) %>% step_discretize_xgb(all_predictors(), outcome = "class")