Conformal prediction band for a single new patient
Source:R/uncertainty-conformal.R
conformalPredict.RdConvenience wrapper around split-conformal conformalInterval() for one new
observation, returning the guaranteed-coverage predicted band.
Arguments
- model
A fitted model (see
conformalInterval()).- calib
The calibration data frame (response + predictors).
- newx
A one-row data frame of predictors for the new patient.
- alpha
Miscoverage level (default 0.1).
- seed
Optional integer random seed.
Examples
set.seed(1)
d <- data.frame(x = rnorm(80)); d$y <- 1.5 * d$x + rnorm(80)
fit <- lm(y ~ x, data = d[1:40, ])
conformalPredict(fit, d[41:80, ], data.frame(x = 0.5))
#> <AnalysisResult> conformal
#> fields: point, lower, upper, alpha, method, quantile
#> provenance: 1 entr(ies)