Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

calibration

Model Calibration


Description

Calculate calibration estimates from observed and predicted responses.

Usage

calibration(
  x,
  y = NULL,
  breaks = 10,
  span = 0.75,
  dist = NULL,
  na.rm = TRUE,
  ...
)

Arguments

x

observed responses or resample result containing observed and predicted responses.

y

predicted responses if not contained in x.

breaks

value defining the response variable bins within which to calculate observed mean values. May be specified as a number of bins, a vector of breakpoints, or NULL to fit smooth curves with splines for predicted survival probabilities and with loess for others.

span

numeric parameter controlling the degree of loess smoothing.

dist

character string specifying a distribution with which to estimate observed survival means. Possible values are "empirical" for the Kaplan-Meier estimator, "exponential", "extreme", "gaussian", "loggaussian", "logistic", "loglogistic", "lognormal", "rayleigh", "t", or "weibull" (default).

na.rm

logical indicating whether to remove observed or predicted responses that are NA when calculating metrics.

...

arguments passed to other methods.

Value

Calibration class object that inherits from data.frame.

See Also

Examples

## Requires prior installation of suggested package gbm to run

library(survival)

res <- resample(Surv(time, status) ~ ., data = veteran, model = GBMModel,
                control = CVControl(times = c(90, 180, 360)))
cal <- calibration(res)
plot(cal)

MachineShop

Machine Learning Models and Tools

v2.8.0
GPL-3
Authors
Brian J Smith [aut, cre]
Initial release
2021-04-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.