Skip to contents

Convenience wrapper that calls .boot_cross_validate() with n_folds = length(y). rsample::loo_cv is the tidymodels equivalent (cross-referenced).

Usage

leave_one_out_cv(X, y, model_fn, score_fn)

Arguments

X

Numeric matrix or data.frame of predictors.

y

Numeric or factor outcome vector aligned with rows of X.

model_fn

Function (X, y) -> fitted-model used on each training fold.

score_fn

Function (y_true, y_pred) -> numeric returning a single performance metric.

Value

A morie_cv_result.