Description Usage Arguments Examples
This function calibrates model predicted probabilities by aligning them with the actual outcome variable through minimizing the log-loss with Platt scaling. Calibrating to a different event rate is also possible with the 'ct' parameter.
1 2 | calibrate_probabilities(df_pred, target, prediction, top_level = "1",
ct = 0)
|
df_pred |
A data frame containing raw model predictions and the target even |
target |
Actual outcome variable |
prediction |
Predicted outcome variable |
top_level |
Top level of the grouping variable. Defaults to "1" |
ct |
Central tendency/event rate to which the prediction is to be calibrated. Defaults to 0 if only the log-loss should be optimized |
1 2 3 4 5 6 7 | set.seed(42)
outcome <- data_frame(
default = rbinom(100, 1, 0.5),
pred = runif(100, 0, 1)
) %>%
calibrate_probabilities(default, pred, "1")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.