kfold-generic {loo}R Documentation

Generic function for K-fold cross-validation for developers

Description

For developers of modeling packages, loo includes a generic function kfold so that methods may be defined for K-fold CV without name conflicts between packages. See, e.g., the kfold.stanreg method in rstanarm and the kfold.brmsfit method in brms.

Usage

kfold(x, ...)

is.kfold(x)

Arguments

x

A fitted model object.

...

Arguments to pass to specific methods.

Value

For developers defining a kfold method for a class "foo", the kfold.foo function should return a list with class c("kfold", "loo") with at least the elements


[Package loo version 2.1.0 Index]