I am currently trying to build an ML pipeline for fMRI data. To get an unbiased estimate of the performance of my pipeline, I use nested cross-validation structure. However, I am not sure in what order hyperparameter optimization and feature selection should be in a nested CV structure. I have four options (but always open for good options):
- 3-loop nested cross-validation.
Outer loop: Model evaluation
Middle loop: Feature selection
Inner loop: Hyperparameter optimization
- 3-loop nested cross-validation.
Outer loop: Model evaluation
Middle loop: Hyperparameter optimization
Inner loop: Feature selection
- 2-loop nested cross-validation
Outer loop: Model evaluation
Middle loop: First feature selection, then hyperparameter optimization
- 2-loop nested cross-validation
Outer loop: Model evaluation
Middle loop: First hyperparameter optimization, then feature selection
Please keep in mind that, fMRI studies generally consist of a small sample (around 20-30 per category) unless you are working on connectomics projects.