We describe a fast computation method for leave-one-out cross-validation (LOOCV) for $k$-nearest neighbours ($k$-NN) regression. We show that, under a tie-breaking condition for nearest neighbours, the LOOCV estimate of the mean square error for $k$-NN regression is identical to the mean square error of $(k+1)$-NN regression evaluated on the training data, multiplied by the scaling factor $(k+1)^2/k^2$. Therefore, to compute the LOOCV score, one only needs to fit $(k+1)$-NN regression only once, and does not need to repeat training-validation of $k$-NN regression for the number of training data. Numerical experiments confirm the validity of the fast computation method.
翻译:我们提出了一种用于$k$近邻回归中留一交叉验证的快速计算方法。我们证明,在最近邻的平局打破条件下,$k$近邻回归的留一交叉验证均方误差估计值等于在训练数据上评估的$(k+1)$近邻回归的均方误差乘以缩放因子$(k+1)^2/k^2$。因此,要计算留一交叉验证分数,只需拟合一次$(k+1)$近邻回归,而无需针对训练数据数量重复进行$k$近邻回归的训练-验证过程。数值实验证实了该快速计算方法的有效性。