Algorithm 2: Model training and hyperparameter optimization for the CNN model. |
-
1:
Define ranges of model hyperparameter values to evaluate
-
2:
for each external fold iteration do ▹ External 5-fold CV
-
3:
Hold-out the samples of this fold (i.e., the test set)
-
4:
Use the rest of samples as calibration set
-
5:
for each iteration of the Hyperband algorithm do
-
6:
for each internal fold iteration in the calibration set do ▹ Internal 5-fold CV
-
7:
Hold-out the samples of this fold (i.e., the validation set)
-
8:
Fit the model on the rest (i.e., the training set)
-
9:
Use the model to predict the held-out samples
-
10:
Calculate and store an accuracy metric for this fold
-
11:
end for
-
12:
Calculate the average performance across all folds
-
13:
end for
-
14:
Determine the optimal hyperparameter set
-
15:
Fit the final model using the calibration set with the optimal hyperparameters
-
16:
Use the model to predict the held-out samples
-
17:
Calculate and store accuracy metrics for this fold
-
18:
end for
-
19:
Calculate the average performance across all folds
|