| cv_LogBip | R Documentation |
Performs k-fold cross-validation for a logistic biplot model across a range of dimensions, enabling selection of the optimal number of latent dimensions.
cv_LogBip(
data,
k = 0:5,
K = 7,
method = "MM",
type = NULL,
plot = TRUE,
maxit = NULL
)
data |
A binary matrix. |
k |
Integer vector of dimensions to evaluate. Default is |
K |
Number of folds. Default is |
method |
Fitting algorithm: |
type |
Update formula for the CG method (see |
plot |
Logical; if |
maxit |
Maximum number of iterations. Defaults to |
A data frame with columns k, cv-error (mean
cross-validation error, in percent), and train-error (mean training
error, in percent).
Giovany Babativa <jgbabativam@unal.edu.co>
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.
LogBip, pred_LB, fitted_LB,
simBin
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.