View source: R/plot_calibration.R
plot_calibration | R Documentation |
This functions plots probability calibration curves for one or several classifiers.
plot_calibration( obs, pred, pal_curves = "npg", title = ifelse(is.numeric(pred), "Calibration Curve", "Calibration Curves"), legend = "right", hover = FALSE )
obs |
Vector of observed outcomes. Must be dichotomous. Can be numeric,
logical, character, or factor. If numeric, |
pred |
Vector of predicted probabilities, or several such vectors
organized into a data frame or list, optionally named. Must be numeric on
|
pal_curves |
String specifying the color palette to use when plotting
multiple vectors. Options include |
title |
Optional plot title. |
legend |
Legend position. Must be one of |
hover |
Show predictor name by hovering mouse over ROC curve? If |
Calibration curves are a quick and easy way to evaluate a classifier's fit to the data. This function allows one or several models to be plotted in the same figure, with points sized by the number of observations that fall within the corresponding bin.
x1 <- runif(1000) y <- rbinom(1000, size = 1, prob = x1) plot_calibration(obs = y, pred = x1) x2 <- rbeta(1000, shape1 = 5/2, shape2 = 3/2) plot_calibration(obs = y, pred = list("Good" = x1, "Bad" = x2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.