if (FALSE) { # rlang::is_installed("probably")
library(tibble)
# create example data
set.seed(1)
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_calibration
# specify calibration
tlr <-
tailor() |>
adjust_numeric_calibration(method = "linear")
# train tailor on a subset of data.
tlr_fit <- fit(tlr, d_calibration, outcome = y, estimate = y_pred)
# apply to predictions on another subset of data
d_test
predict(tlr_fit, d_test)
}
Run the code above in your browser using DataLab