dplot3_calibration: Draw calibration plot

View source: R/dplot3_calibration.R

dplot3_calibrationR Documentation

Draw calibration plot

Description

Draw calibration plot

Usage

dplot3_calibration(
  true.labels,
  est.prob,
  n.bins = 10,
  bin.method = c("equidistant", "quantile"),
  pos.class.idi = 1,
  xlab = "Mean estimated probability",
  ylab = "Empirical risk",
  mode = "markers+lines",
  ...
)

Arguments

true.labels

Factor or list of factors with true class labels

est.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.idi

Integer: Index of the positive class

xlab

Character: x-axis label

ylab

Character: y-axis label

mode

Character: Plot mode

...

Additional arguments passed to dplot3_xy

Author(s)

EDG

Examples

## Not run: 
data(segment_logistic, package = "probably")

# Plot the calibration curve of the original predictions
dplot3_calibration(
  true.labels = segment_logistic$Class,
  est.prob = segment_logistic$.pred_poor,
  n.bins = 10,
  pos.class.idi = 2
)

# Plot the calibration curve of the calibrated predictions
dplot3_calibration(
  true.labels = segment_logistic$Class,
  est.prob = calibrate(
    segment_logistic$Class,
    segment_logistic$.pred_poor
  )$fitted.values,
  n.bins = 10,
  pos.class.idi = 2
)

## End(Not run)

egenn/rtemis documentation built on May 4, 2024, 7:40 p.m.