View source: R/dplot3_calibration.R
dplot3_calibration | R Documentation |
Draw calibration plot
dplot3_calibration(
true.labels,
predicted.prob,
n.bins = 10,
bin.method = c("quantile", "equidistant"),
pos.class = NULL,
main = NULL,
subtitle = NULL,
xlab = "Mean predicted probability",
ylab = "Empirical risk",
show.marginal.x = TRUE,
marginal.x.y = -0.02,
marginal.col = NULL,
marginal.size = 10,
mode = "markers+lines",
show.brier = TRUE,
theme = rtTheme,
filename = NULL,
...
)
true.labels |
Factor or list of factors with true class labels |
predicted.prob |
Numeric vector or list of numeric vectors with predicted probabilities |
n.bins |
Integer: Number of windows to split the data into |
bin.method |
Character: "quantile" or "equidistant": Method to bin the estimated probabilities. |
pos.class |
Integer: Index of the positive class |
main |
Character: Main title |
subtitle |
Character: Subtitle, placed bottom right of plot |
xlab |
Character: x-axis label |
ylab |
Character: y-axis label |
show.marginal.x |
Logical: Add marginal plot of distribution of estimated probabilities |
marginal.x.y |
Numeric: Y position of marginal markers on x-axis |
marginal.col |
Color for marginal markers |
marginal.size |
Numeric: Size of marginal markers |
mode |
Character: "lines", "markers", "lines+markers": How to plot. |
show.brier |
Logical: If TRUE, add Brier scores to trace names. |
theme |
List or Character: Either the output of a |
filename |
Character: Path to save output. |
... |
Additional arguments passed to dplot3_xy |
EDG
## Not run:
data(segment_logistic, package = "probably")
# Plot the calibration curve of the original predictions
dplot3_calibration(
true.labels = segment_logistic$Class,
predicted.prob = segment_logistic$.pred_poor,
n.bins = 10,
pos.class = 2
)
# Plot the calibration curve of the calibrated predictions
dplot3_calibration(
true.labels = segment_logistic$Class,
predicted.prob = calibrate(
segment_logistic$Class,
segment_logistic$.pred_poor
)$fitted.values,
n.bins = 10,
pos.class = 2
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.