Skip to content

Commit

Permalink
rename potato -> calibration (closes #48)
Browse files Browse the repository at this point in the history
  • Loading branch information
simonpcouch committed Sep 24, 2024
1 parent 3385fbc commit e81dffd
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions R/adjust-numeric-calibration.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@
#'
#' # create example data
#' set.seed(1)
#' d_potato <- tibble(y = rnorm(100), y_pred = y/2 + rnorm(100))
#' d_calibration <- tibble(y = rnorm(100), y_pred = y/2 + rnorm(100))
#' d_test <- tibble(y = rnorm(100), y_pred = y/2 + rnorm(100))
#'
#' d_potato
#' d_calibration
#'
#' # specify calibration
#' tlr <-
Expand All @@ -38,7 +38,7 @@
#'
#' # train tailor on a subset of data. situate in a modeling workflow with
#' # `workflows::add_tailor()` to avoid having to specify column names manually
#' tlr_fit <- fit(tlr, d_potato, outcome = y, estimate = y_pred)
#' tlr_fit <- fit(tlr, d_calibration, outcome = y, estimate = y_pred)
#'
#' # apply to predictions on another subset of data
#' d_test
Expand Down
6 changes: 3 additions & 3 deletions R/adjust-probability-calibration.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
#' # split example data
#' set.seed(1)
#' in_rows <- sample(c(TRUE, FALSE), nrow(two_class_example), replace = TRUE)
#' d_potato <- two_class_example[in_rows, ]
#' d_calibration <- two_class_example[in_rows, ]
#' d_test <- two_class_example[!in_rows, ]
#'
#' head(d_potato)
#' head(d_calibration)
#'
#' # specify calibration
#' tlr <-
Expand All @@ -37,7 +37,7 @@
#' # `workflows::add_tailor()` to avoid having to specify column names manually
#' tlr_fit <- fit(
#' tlr,
#' d_potato,
#' d_calibration,
#' outcome = c(truth),
#' estimate = c(predicted),
#' probabilities = c(Class1, Class2)
Expand Down
6 changes: 3 additions & 3 deletions man/adjust_numeric_calibration.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/adjust_probability_calibration.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions tests/testthat/test-adjust-numeric-calibration.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ test_that("basic adjust_numeric_calibration usage works", {
library(tibble)

set.seed(1)
d_potato <- tibble(y = rnorm(100), y_pred = y/2 + rnorm(100))
d_calibration <- tibble(y = rnorm(100), y_pred = y/2 + rnorm(100))
d_test <- tibble(y = rnorm(100), y_pred = y/2 + rnorm(100))

# fitting and predicting happens without raising conditions
Expand All @@ -13,7 +13,7 @@ test_that("basic adjust_numeric_calibration usage works", {
)

expect_no_condition(
tlr_fit <- fit(tlr, d_potato, outcome = y, estimate = y_pred)
tlr_fit <- fit(tlr, d_calibration, outcome = y, estimate = y_pred)
)

expect_no_condition(
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-adjust-probability-calibration.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test_that("basic adjust_probability_calibration() usage works", {
# split example data
set.seed(1)
in_rows <- sample(c(TRUE, FALSE), nrow(two_class_example), replace = TRUE)
d_potato <- two_class_example[in_rows, ]
d_calibration <- two_class_example[in_rows, ]
d_test <- two_class_example[!in_rows, ]

# fitting and predicting happens without raising conditions
Expand All @@ -20,7 +20,7 @@ test_that("basic adjust_probability_calibration() usage works", {
expect_no_condition(
tlr_fit <- fit(
tlr,
d_potato,
d_calibration,
outcome = c(truth),
estimate = c(predicted),
probabilities = c(Class1, Class2)
Expand Down

0 comments on commit e81dffd

Please sign in to comment.