Skip to contents

Computes standard errors of the fit for newdata from the fitted model, after applying the model's stored preprocessing.

Usage

se(x, newdata, ...)

Arguments

x

Supervised object.

newdata

tabular data: Features to compute standard errors for.

...

Additional arguments passed to methods.

Value

Numeric vector of standard errors, one per case, or NULL when the algorithm reports none.

Details

Available for GLM and GAM, which report the standard error of the linear predictor, for BART, which reports the posterior standard deviation of the mean function, and for LINADForest, which reports the infinitesimal jackknife estimate. A multiclass GAM and every other algorithm return NULL.

Author

EDG

Examples

x <- data.frame(age = rnorm(100), bmi = rnorm(100))
x[["y"]] <- x[["age"]] * 2 + rnorm(100, sd = 0.3)
mod <- train(x, hyperparameters = setup_GLM(), verbosity = 0L)
se(mod, features(x)[1:5, ])
#>          1          2          3          4          5 
#> 0.04050241 0.02852725 0.04486365 0.03216885 0.03474383