What is the cost of nested cross-validation in terms of the number of times the algorithm needs to perform a fit-evaluate step?
Based on this description of the algorithm, I think the answer is:
$n \times k \times j \times m$
Where:
- $n$ is the number of models you are evaluating.
- $k$ is the number of folds in the outer cross validation.
- $j$ is the number of folds in the inner cross validation.
- $m$ is the number of combinations of hyperparameters to compare at each stage.
I am a little confused on this. According to this article and this one, they seem to indicate a cost of:
$n \times k^2$
I have no problem understanding that the $k^2$ is really just a special case of $j \times k$, where $j = k$, as I'm sure it often is. But what about the number of different combinations of hyperparameters that need to be evaluated for the inner cross validation, which I am calling $m$? Is there a reason that $m$ is being left out in the cost calculation of $n \times k^2$ e.g. $m$ is usually small, or did the authors just forget to add it in?