bimm_cv: Cross-validation for BiMMs

View source: R/bimm_cv.R

bimm_cvR Documentation

Cross-validation for BiMMs

Description

Cross-validation for BiMMs

Usage

bimm_cv(
  data,
  formula,
  verbose,
  n_fold = 10,
  n_iteration = 5,
  evaluation_metric = "auc"
)

Arguments

data

a data frame containing the variables in the model.

formula

An object of class "formula" that is akin to formula in lme4::lmer() where both fixed and random effects are written. Random-effects terms are distinguished by vertical bars (|) inside of parentheses. See examples.

verbose

An integer value of 0, 1, or 2.

  • If verbose = 0, nothing is printed to console.

  • If verbose = 1, select steps are printed to console.

  • If verbose = 2, almost all processes are printed to console.

n_fold

an integer value of 2 or higher indicating how many folds should be created to run cross-validation. More folds => more computation time. Less folds => higher variability in performance assessments.

n_iteration

A positive integer indicating how many iterations to complete. More details on 'iterations' can be found in the 'Details' section.

evaluation_metric

A character value indicating which evaluation metric to track as iterations are completed. Valid options are 'auc' for the area underneath the receiver operator characteristic curve and 'bri' for the Brier score.

Value

a dataframe with estimated evaluation metrics at each iteration of the bimm fitting procedure.


bcjaeger/bimm documentation built on Sept. 14, 2024, 3:41 a.m.