calibrate_regression: Calibrate a regression caretx model.

View source: R/utils_calibration.R

calibrate_regressionR Documentation

Calibrate a regression caretx model.

Description

Enables post-hoc quantile GAM calibration of the ML predictions using the qgam tool.

Usage

calibrate_regression(
  caretx_model,
  newdata = NULL,
  bs = "cr",
  k = 20,
  qu = 0.5,
  form = NULL,
  lsig = NULL,
  err = NULL,
  control = list(link = "identity"),
  argGam = NULL,
  ...
)

Arguments

caretx_model

caretx model.

newdata

test data set.

bs

basis function for the smoother, ignored if a formula provided.

k

degrees of freedom for the smoother, ignored if a formula provided..

qu

quantile for the calibration, see: qgam for details.

form

GAM formula as specified by formula.gam. The uncalibrated predictions are stored internally in the '.raw' variable, which needs to be included in the user-provided formula.

lsig

the value of the log learning rate used to create the Gibbs posterior, see: qgam for details.

err

an upper bound on the error of the estimated quantile curve, see: qgam for details.

control

a list of control parameters passed to qgam.

argGam

a list of parameters to be passed to gam, with the exception of formula, family and data.

...

extra arguments passed to qgam.

Details

The calibration is developed for the training data set and applied by prediction to the CV and, if newdata provided, to the test data.

Value

a list of predx objects (train, cv and, if newdata provided, test) along with the gamObject named cal_fit, the chosen quantile value (qu) and values of explained deviance (qu_tbl).


PiotrTymoszuk/caretExtra documentation built on Oct. 15, 2023, 10:03 p.m.