Predicted probability against the observed proportion of events. A model whose points sit on the diagonal predicts the level it claims; one above the diagonal under-predicts risk and one below over-predicts.
Usage
plot_calibration(
probability,
outcome,
positive = NULL,
bins = 10,
smooth = FALSE,
show_ci = TRUE,
palette = "house",
ci_level = 0.95,
xlab = "Predicted probability",
ylab = "Observed proportion",
title = NULL,
font = "Arial"
)Arguments
- probability
Predicted probabilities, or a matrix or data frame with one column per model.
- outcome
Binary outcome, one value per observation.
- positive
Value of
outcomethat represents the event.- bins
Number of groups to divide the predictions into. Quantile bins are used, so every point rests on a similar number of observations.
- smooth
Draw a loess curve through the points instead of connecting them.
- show_ci
Draw binomial confidence intervals for each point.
- palette
Palette name passed to
get_color().- ci_level
Confidence level of the intervals.
- xlab, ylab, title
Axis and plot labels.
- font
Font family used in the plot.
See also
plot_ROC() for discrimination, plot_decision_curve() for
whether acting on the predictions helps.