Skip to content

Commit

Permalink
add skip on CRAN for discretize_xgboost
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilHvitfeldt committed Aug 17, 2023
1 parent 1a04ccc commit 6300c9d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/testthat/test-discretize_xgb.R
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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 <-
Expand Down Expand Up @@ -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 <-
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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)
Expand All @@ -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)))

Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit 6300c9d

Please sign in to comment.