Skip to main content
. Author manuscript; available in PMC: 2024 Jan 1.
Published in final edited form as: J Comput Graph Stat. 2022 Dec 13;32(3):1097–1108. doi: 10.1080/10618600.2022.2146697

Algorithm 2.

Repeated Cross Validation

1: Split dataset into test and cross validation subsets 𝓣 and 𝓓, respectively.
2: for each replicate r1,R do
3: Shuffle subset 𝓓.
4: for each fold1, K do
5: Split 𝓓 into training and validation subsets, 𝓓1 and 𝓓2.
6: Estimate transformation parameters from the training set 𝓓1.
7: Apply the transformation to 𝓓1, 𝓓2 and 𝓣 to standardize/normalize data.
8: for each λ do
9: Initialize model parameters β or α by fitting a L2 SVM using (2) or (7).
10: for each s do
11: Fit a sparse classifier with k=p(1s) active features.
12: Evaluate prediction accuracy on subsets 𝓓1, 𝓓2 and 𝓣.
13: end for
14: end for
15: end for
16: Evaluate average scores SCV(𝓓1), SCV(𝓓2) and SCV(𝓣) for each subset.
17: Rank models by their augmented scores (SCV(𝓓2), s, λ).
18: Identify and record the optimal hyperparameters s, k, and λ.
19: end for