calibrate | R Documentation |
Calibrate predicted probabilities
calibrate(
true.labels,
predicted.prob,
pos.class = NULL,
alg = "isotonic",
learn.params = list(),
verbose = TRUE
)
true.labels |
Factor with true class labels. |
predicted.prob |
Numeric vector with predicted probabilities. |
pos.class |
Integer: Index of the positive class. |
alg |
Character: Algorithm to use to train calibration model. See |
learn.params |
List: List of parameters to pass to the learning algorithm |
verbose |
Logical: If TRUE, print messages to the console |
Trained calibration model. Use $fitted.values
to get calibrated
input probabilities; use predict(mod, newdata = newdata, type = "response")
to calibrate other estimated probabilities.
EDG
## Not run:
data("segment_naive_bayes", package = "probably")
# Plot the calibration curve of the original predictions
dplot3_calibration(
true.labels = segment_naive_bayes$Class,
predicted.prob = segment_naive_bayes$.pred_poor,
pos.class = 2
)
# Plot the calibration curve of the calibrated predictions
dplot3_calibration(
true.labels = segment_naive_bayes$Class,
predicted.prob = calibrate(
segment_naive_bayes$Class,
segment_naive_bayes$.pred_poor
)$fitted.values,
pos.class = 2
)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.