-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
‘topepo’
committed
Apr 25, 2024
1 parent
3cab3e0
commit 917196f
Showing
18 changed files
with
57 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ctr_cls <- container(mode = "classification") | ||
ctr_reg <- container(mode = "classification") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
test_that("adjustment printing", { | ||
expect_snapshot(container() %>% adjust_equivocal_zone()) | ||
expect_snapshot(container() %>% adjust_equivocal_zone(hardhat::tune())) | ||
expect_snapshot(ctr_cls %>% adjust_equivocal_zone()) | ||
expect_snapshot(ctr_cls %>% adjust_equivocal_zone(hardhat::tune())) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
test_that("adjustment printing", { | ||
dummy_reg_cal <- structure(list(), class = "cal_regression") | ||
expect_snapshot(container() %>% adjust_numeric_calibration(dummy_reg_cal)) | ||
expect_snapshot(ctr_reg %>% adjust_numeric_calibration(dummy_reg_cal)) | ||
}) | ||
|
||
test_that("errors informatively with bad input", { | ||
# check for `adjust_numeric_calibration(container)` is in `utils.R` tests | ||
|
||
expect_snapshot(error = TRUE, adjust_numeric_calibration(container())) | ||
expect_snapshot(error = TRUE, adjust_numeric_calibration(container(), "boop")) | ||
expect_snapshot(error = TRUE, adjust_numeric_calibration(ctr_reg)) | ||
expect_snapshot(error = TRUE, adjust_numeric_calibration(ctr_reg, "boop")) | ||
dummy_cls_cal <- structure(list(), class = "cal_binary") | ||
expect_snapshot( | ||
error = TRUE, | ||
adjust_numeric_calibration(container(), dummy_cls_cal) | ||
) | ||
expect_snapshot(error = TRUE, adjust_numeric_calibration(ctr_cls, dummy_cls_cal)) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
test_that("adjustment printing", { | ||
expect_snapshot(container() %>% adjust_numeric_range()) | ||
expect_snapshot(container() %>% adjust_numeric_range(hardhat::tune())) | ||
expect_snapshot(container() %>% adjust_numeric_range(-1, hardhat::tune())) | ||
expect_snapshot(container() %>% adjust_numeric_range(hardhat::tune(), 1)) | ||
expect_snapshot(ctr_reg %>% adjust_numeric_range()) | ||
expect_snapshot(ctr_reg %>% adjust_numeric_range(hardhat::tune())) | ||
expect_snapshot(ctr_reg %>% adjust_numeric_range(-1, hardhat::tune())) | ||
expect_snapshot(ctr_reg %>% adjust_numeric_range(hardhat::tune(), 1)) | ||
}) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
test_that("adjustment printing", { | ||
expect_snapshot(container() %>% adjust_predictions_custom()) | ||
expect_snapshot(ctr_cls %>% adjust_predictions_custom()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
test_that("adjustment printing", { | ||
dummy_cls_cal <- structure(list(), class = "cal_binary") | ||
expect_snapshot(container() %>% adjust_probability_calibration(dummy_cls_cal)) | ||
expect_snapshot(ctr_cls %>% adjust_probability_calibration(dummy_cls_cal)) | ||
}) | ||
|
||
test_that("errors informatively with bad input", { | ||
# check for `adjust_probably_calibration(container)` is in `utils.R` tests | ||
|
||
expect_snapshot(error = TRUE, adjust_probability_calibration(container())) | ||
expect_snapshot(error = TRUE, adjust_probability_calibration(container(), "boop")) | ||
expect_snapshot(error = TRUE, adjust_probability_calibration(ctr_cls)) | ||
expect_snapshot(error = TRUE, adjust_probability_calibration(ctr_cls, "boop")) | ||
dummy_reg_cal <- structure(list(), class = "cal_regression") | ||
expect_snapshot( | ||
error = TRUE, | ||
adjust_probability_calibration(container(), dummy_reg_cal) | ||
adjust_probability_calibration(ctr_cls, dummy_reg_cal) | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
test_that("adjustment printing", { | ||
expect_snapshot(container() %>% adjust_probability_threshold()) | ||
expect_snapshot(container() %>% adjust_probability_threshold(hardhat::tune())) | ||
expect_snapshot(ctr_cls %>% adjust_probability_threshold()) | ||
expect_snapshot(ctr_cls %>% adjust_probability_threshold(hardhat::tune())) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
test_that("check_container raises informative error", { | ||
expect_snapshot(error = TRUE, adjust_probability_threshold("boop")) | ||
expect_no_condition(container() %>% adjust_probability_threshold(.5)) | ||
expect_no_condition(ctr_cls %>% adjust_probability_threshold(.5)) | ||
}) |