calibrate {CalibratR} | R Documentation |
calibrate
Description
Builds selected calibration models on the supplied trainings values actual
and predicted
and returns them
to the user. New test instances can be calibrated using the predict_calibratR
function.
Returns cross-validated calibration and discrimination error values for the models if evaluate_CV_error
is set to TRUE. Repeated cross-Validation can be time-consuming.
Usage
calibrate(actual, predicted, model_idx = c(1, 2, 3, 4, 5),
evaluate_no_CV_error = TRUE, evaluate_CV_error = TRUE, folds = 10,
n_seeds = 30, nCores = 4)
Arguments
actual |
vector of observed class labels (0/1) |
predicted |
vector of uncalibrated predictions |
model_idx |
which calibration models should be implemented, 1=hist_scaled, 2=hist_transformed, 3=BBQ_scaled, 4=BBQ_transformed, 5=GUESS, Default: c(1, 2, 3, 4, 5) |
evaluate_no_CV_error |
computes internal errors for calibration models that were trained on all available |
evaluate_CV_error |
computes cross-validation error. |
folds |
number of folds in the cross-validation of the calibration model. If |
n_seeds |
|
nCores |
|
Details
parallised execution of random data set splits for the Cross-Validation procedure over n_seeds
Value
A list object with the following components:
calibration_models |
a list of all trained calibration models, which can be used in the |
summary_CV |
a list containing information on the CV errors of the implemented models |
summary_no_CV |
a list containing information on the internal errors of the implemented models |
predictions |
calibrated predictions for the original |
n_seeds |
number of random data set partitions into training and test set for |
Author(s)
Johanna Schwarz
Examples
## Loading dataset in environment
data(example)
actual <- example$actual
predicted <- example$predicted
## Create calibration models
calibration_model <- calibrate(actual, predicted,
model_idx = c(1,2),
FALSE, FALSE, folds = 10, n_seeds = 1, nCores = 2)