diff --git a/tests/testthat/_snaps/cal-estimate.md b/tests/testthat/_snaps/cal-estimate.md index e64c2543..bdb7f406 100644 --- a/tests/testthat/_snaps/cal-estimate.md +++ b/tests/testthat/_snaps/cal-estimate.md @@ -151,7 +151,7 @@ Type: Binary Source class: Data Frame Data points: 1,010, split in 2 groups - Unique Predicted Values: 19 + Unique Predicted Values: 59 Truth variable: `Class` Estimate variables: `.pred_good` ==> good diff --git a/tests/testthat/test-cal-estimate.R b/tests/testthat/test-cal-estimate.R index 1d73d69a..68fdff05 100644 --- a/tests/testthat/test-cal-estimate.R +++ b/tests/testthat/test-cal-estimate.R @@ -112,6 +112,7 @@ test_that("Isotonic estimates work - data.frame", { expect_cal_rows(sl_isotonic) expect_snapshot(print(sl_isotonic)) + set.seed(100) sl_isotonic_group <- segment_logistic %>% dplyr::mutate(group = .pred_poor > 0.5) %>% cal_estimate_isotonic(Class, .by = group) @@ -121,17 +122,20 @@ test_that("Isotonic estimates work - data.frame", { expect_cal_rows(sl_isotonic_group) expect_snapshot(print(sl_isotonic_group)) + set.seed(100) expect_snapshot_error( segment_logistic %>% dplyr::mutate(group1 = 1, group2 = 2) %>% cal_estimate_isotonic(Class, .by = c(group1, group2)) ) + set.seed(100) iso_configs <- bin_with_configs() %>% cal_estimate_isotonic(truth = Class) expect_true(are_groups_configs(iso_configs)) + set.seed(100) mltm_configs <- mnl_with_configs() %>% cal_estimate_isotonic(truth = obs, estimate = c(VF:L))