= Solution
Choose a candidate grid of $C>0$. For each candidate and each $i$, fit the <soft-margin support vector machine> to all observations except $i$, keeping exactly the same $C$ in the unnormalized sum objective. Let $f_{-i,C}$ be its fitted score. Use a fixed rule for assigning a label when the score is zero. The binary misclassification estimate from <Leave-one-out cross-validation> is
$$
\boxed{\operatorname{err}_{CV}(C)=\frac1n\sum_{i=1}^n\mathbf1_{\{\operatorname{sign}(f_{-i,C}(x_i))\ne y_i\}}.}
$$
Choose a minimizing candidate, break tuning ties by a predetermined rule, and refit on all $n$ observations. Any estimated preprocessing must also be fitted inside each training fold to avoid <data leakage>. If a normalized average-loss parameterization is used instead, translate its parameter so that the same $C$ is retained when the sample size decreases.
Back to article page