Skip to content

Instantly share code, notes, and snippets.

@topepo
Created October 29, 2024 12:48
Show Gist options
  • Save topepo/b93f929159878c98b02c05cecac0d3e9 to your computer and use it in GitHub Desktop.
Save topepo/b93f929159878c98b02c05cecac0d3e9 to your computer and use it in GitHub Desktop.
demonstration of probably's calibration functions with non-standard names and groups
library(tidymodels)
library(probably)
set.seed(12)
example <-
two_class_example %>%
mutate(
model = sample(c("logistic", "xgboost"), size = nrow(two_class_example), replace = TRUE)
) %>%
rename(`$@#!` = Class1, cls_2.5 = Class2)
example %>%
cal_plot_windowed(truth, `$@#!`, .by = c(model))
beta_cal <-
example %>%
cal_estimate_beta(truth, estimate = c(`$@#!`, cls_2.5), .by = c(model))
beta_cal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment