
Predict Prediction Intervals via Last-Layer Laplace Approximation
Source:R/postprocess_intervals_regression.R
laplace_pred_int_reg.RdPredict-time entry point for regression prediction intervals. Called by
parsnip via
c(pkg = "kerasnip", fun = "laplace_pred_int_reg").
For each output in the model, this builds the per-sample predictive variance
(uncertainty on a new observation Y|X = epistemic variance + observation
noise) from the stored Laplace posterior and returns symmetric Normal-based
intervals at the requested level.
Arguments
- object
The raw Keras model (from
object$fit$fit).- x
Processed predictor data (matrix or array).
- laplace_data
A named list of Laplace posterior data, one entry per output (from
object$fit$laplace). Each entry containsh_diag,tau,sigma_sq_noise,n_training, andcombined_model.- level
Confidence level (default 0.95). Passed through from
predict(..., type = "conf_int", level = 0.95).