View source: R/calibrate_slide.R
calibrate_slide | R Documentation |
Calibrate predicted probabilities using a generalized additive model (GAM).
calibrate_slide(
true_labels,
est_prob,
n_windows = NULL,
pos_class_idi = 1,
k = 9,
verbose = TRUE
)
true_labels |
Factor with true class labels |
est_prob |
Numeric vector with predicted probabilities |
n_windows |
Integer: Number of calibration windows |
pos_class_idi |
Integer: Index of the positive class |
k |
Integer: GAM degrees of freedom |
verbose |
Logical: If TRUE, printe messages to the console |
This is meant for experimentation.
List with mod: fitted GAM model to be used for calibration of new data calibrated_prob: Numeric vector with calibrated probabilities
EDG
## 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_windows = 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),
n_windows = 10,
pos_class_idi = 2
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.