cv_LogBip: Cross-Validation for Logistic Biplot

View source: R/cv_LogBip.R

cv_LogBipR Documentation

Cross-Validation for Logistic Biplot

Description

Performs k-fold cross-validation for a logistic biplot model across a range of dimensions, enabling selection of the optimal number of latent dimensions.

Usage

cv_LogBip(
  data,
  k = 0:5,
  K = 7,
  method = "MM",
  type = NULL,
  plot = TRUE,
  maxit = NULL
)

Arguments

data

A binary matrix.

k

Integer vector of dimensions to evaluate. Default is 0:5.

K

Number of folds. Default is K = 7.

method

Fitting algorithm: "MM" (default), "CG", "PDLB", or "BFGS".

type

Update formula for the CG method (see LogBip).

plot

Logical; if TRUE (default), the cross-validation error curve is plotted.

maxit

Maximum number of iterations. Defaults to 100 for gradient methods and 2000 for the MM algorithm.

Value

A data frame with columns k, cv-error (mean cross-validation error, in percent), and train-error (mean training error, in percent).

Author(s)

Giovany Babativa <jgbabativam@unal.edu.co>

References

Bro, R., Kjeldahl, K., & Smilde, A. K. (2008). Cross-validation of component models: a critical look at current methods. Analytical and Bioanalytical Chemistry, 390(5), 1241–1251.

Wold, S. (1978). Cross-validatory estimation of the number of components in factor and principal components models. Technometrics, 20(4), 397–405.

See Also

LogBip, pred_LB, fitted_LB, simBin

Examples


set.seed(1234)
x <- simBin(n = 100, p = 50, k = 3, D = 0.5, C = 20)

# Cross-validation using the MM algorithm
cv_MM <- cv_LogBip(data = x$X, k = 0:5, method = "MM", maxit = 1000)

# Cross-validation using the PDLB algorithm
cv_PB <- cv_LogBip(data = x$X, k = 0:5, method = "PDLB", maxit = 1000)


BiplotML documentation built on May 8, 2026, 5:06 p.m.

Related to cv_LogBip in BiplotML...