if (FALSE) { # rlang::is_installed(c("probably", "modeldata"))
library(modeldata)
# `predicted` gives hard class predictions based on probability threshold .5
head(two_class_example)
# use a threshold of .1 instead:
tlr <-
tailor() |>
adjust_probability_threshold(.1)
# fit by supplying column names.
tlr_fit <- fit(
tlr,
two_class_example,
outcome = c(truth),
estimate = c(predicted),
probabilities = c(Class1, Class2)
)
# adjust hard class predictions
predict(tlr_fit, two_class_example) |> head()
}
Run the code above in your browser using DataLab