BBQ_CV function

BBQ_CV

BBQ_CV

trains and evaluates the BBQ calibration model using folds-Cross-Validation (CV). The predicted values are partitioned into n subsets. A BBQ model is constructed on (n-1) subsets; the remaining set is used for testing the model. All test set predictions are merged and used to compute error metrics for the model.

BBQ_CV(actual, predicted, method_for_prediction = 0, n_folds = 10, seed, input)

Arguments

  • actual: vector of observed class labels (0/1)
  • predicted: vector of uncalibrated predictions
  • method_for_prediction: 0=selection, 1=averaging, Default: 0
  • n_folds: number of folds in the cross-validation, Default: 10
  • seed: random seed to alternate the split of data set partitions
  • input: specify if the input was scaled or transformed, scaled=1, transformed=2

Returns

list object containing the following components: - error: list object that summarizes discrimination and calibration errors obtained during the CV

  • pred_idx: which BBQ prediction method was used during CV, 0=selection, 1=averaging

  • type: "BBQ"

  • probs_CV: vector of calibrated predictions that was used during the CV

  • actual_CV: respective vector of true values (0 or 1) that was used during the CV

Examples

## Loading dataset in environment data(example) actual <- example$actual predicted <- example$predicted BBQ_model <- CalibratR:::BBQ_CV(actual, predicted, method_for_prediction=0, n_folds=4, 123, 1)
  • Maintainer: Dominik Heider
  • License: LGPL-3
  • Last published: 2019-08-19

Useful links