# A mathematical formula for K-fold cross-validation prediction error?

Could anyone elaborate on a theoretical perspective of K-fold cross-validation and especially a mathematical formula for k-fold CV prediction error?

Updated:Could any one of you help me to understand the formula written on latest edition (Feb, 2011) of the book at page 242.

• If you want just how-to-do-it, it has been already answered, for instance here: stats.stackexchange.com/questions/1826/… – user88 Oct 23 '11 at 7:35
• @mbq: I know that how it works, but I need mathematical formula for this prediction error. I have applied Least Angle regression (R package 'lars'). So I am looking for mathematical formula for this cross validation procedure for R function (cv.lars) in 'lars' package. – Biostat Oct 23 '11 at 10:36
• Well, now I'm confused -- what do you mean by "mathematical formula" in this case? – user88 Oct 23 '11 at 12:59
• how I can write K-Fold cross-validation prediction error in mathematical form? – Biostat Oct 23 '11 at 14:48

The formula in the book isn't saying very much it is just saying that the cross-validation error is the average of the loss function (L) evaluated using models trained on different subsets of the data. The superscript $-\kappa(i)$ just means "model $f$ is trained without the training patterns in the same partition of the dataset as pattern $i$". Sometimes writing things in formal mathematical notation makes things less ambiguous, but it doesn't necessarily make it any easier to understand than the text - I think this is one of those occasions.