让验证数据的缺失模式与部署时一致——这条简单的原则,平均能为所选分类器挽回 1.14 个百分点的平衡准确率;缺失率越高,它越重要。Match the missingness pattern of your validation data to what you expect at deployment: this simple rule recovers 1.14 pp of balanced accuracy for the selected classifier on average — and matters more as missingness grows.
01问题:验证时的缺失,与部署时一样吗?The question: does validation go missing the way deployment does?
时间序列分类器通常在验证集上“选秀”。但传感器掉线、记录中断,会让部署时的数据以另一种方式缺失:可能是零散的点缺失,也可能是连续的块缺失。两者可以删去同样多的观测值,却留下截然不同的时间结构。
Time-series classifiers are usually chosen on validation data. But dropped sensors and interrupted logging mean that deployment data may go missing in a different way: as scattered point missingness or as contiguous block missingness. The two can remove the same number of observations yet leave very different temporal structure behind.
已有工作研究过缺失对预测性能的影响。我们关心的是另一件事:选择决策本身。在固定缺失率下,验证集与测试集的缺失模式失配,会不会让我们选错分类器?又会损失多少?
Prior work studies how missingness affects predictive performance. We ask about something else: the selection decision itself. At a fixed missingness rate, does a mismatch between validation and test missingness patterns lead us to pick the wrong classifier — and what does it cost?
02点缺失与(循环)块缺失Point vs (circular) block missingness
两种模式删除完全相同数量的观测 k = ⌊rT⌋。点缺失均匀不放回地抽取 k 个位置;循环块缺失随机选择起点 s,遮蔽 {(s + j) mod T}——块可以从序列末尾“绕回”开头,从而保证每个位置被遮蔽的边际概率都是 k/T。缺失值随后用固定的线性插补填充。亲手试试:
Both patterns remove exactly k = ⌊rT⌋ observations. Point missingness samples k positions uniformly without replacement; circular block missingness picks a random start s and masks {(s + j) mod T} — a block may wrap from the end of the series to its start, so every position has the same marginal masking probability k/T. Missing values are then filled by fixed linear interpolation. Try it:
03实验设计:受控的 2 × 2Design: a controlled 2 × 2
对每个数据集与种子,官方训练集按 75/25 分层划分为完整的拟合子集与验证子集;候选模型只在完整数据上训练,缺失仅注入验证集与官方测试集。三个预先指定的候选:1NN-DTW、MiniRocket + Ridge,以及基于十个统计特征的随机森林。验证集上平衡准确率最高者被选中,然后在同一份被遮蔽的测试集上评估。
For each dataset and seed, the official training set is split 75/25 (stratified) into a complete fitting subset and a validation subset; candidates are trained only on complete data, and missingness is injected only into the validation set and the official test set. Three pre-specified candidates: 1NN-DTW, MiniRocket + Ridge, and a Random Forest on ten statistical features. The candidate with the best validation balanced accuracy is selected and then evaluated on the same masked test set.
遗憾(regret)= 测试集上事后最佳候选的平衡准确率 − 所选候选的平衡准确率。数值为 64 个数据集在种子与缺失率上的平均(论文表 3)。
Regret = balanced accuracy of the retrospectively best candidate on the test set − that of the selected candidate. Values are averages over 64 datasets, seeds and rates (Table 3 of the paper).
04主要结果Results
失配验证使所选分类器的测试平衡准确率平均降低 1.14 pp(95% CI 0.79–1.51;49 个数据集变差、7 个变好、8 个持平;Wilcoxon p = 1.8 × 10⁻⁹),选错率上升 6.4 pp。损失随缺失率稳步增长:5% 时与零无异,30% 时达到 2.46 pp;数据集层面的斜率为每 1 pp 缺失率损失 0.091 pp。
Mismatched validation lowered the test balanced accuracy of the selected classifier by 1.14 pp on average (95% CI 0.79–1.51; 49 datasets worse, 7 better, 8 equal; Wilcoxon p = 1.8 × 10⁻⁹) and raised the selection-error rate by 6.4 pp. The loss grows steadily with the rate: indistinguishable from zero at 5%, 2.46 pp at 30%; the dataset-level slope is 0.091 pp per percentage point of missingness.
| 比较Comparison | ΔBA (pp) | 95% CI | 差/好/平W/B/E | p |
|---|---|---|---|---|
| 两类测试合计Both targets | 1.14 | [0.79, 1.51] | 49/7/8 | 1.8 × 10⁻⁹ |
| 点缺失测试(BP vs PP)Point test (BP vs PP) | 1.84 | [1.23, 2.50] | 43/13/8 | 7.4 × 10⁻⁷ |
| 块缺失测试(PB vs BB)Block test (PB vs BB) | 0.44 | [−0.11, 1.03] | 34/22/8 | 0.20 |
05为什么只在点缺失部署时吃亏?Why does it hurt mainly under point-masked deployment?
效应几乎全部来自点缺失的部署场景(1.84 pp),而块缺失部署的损失很小且不显著。候选层面的结果提示了一种机制:在点缺失测试中,MiniRocket-Ridge 占据了 84.0% 的“事后最佳”份额,偏离它代价高昂;而块缺失的验证集恰恰把选择从 MiniRocket 推向了 1NN-DTW 与随机森林——它们在 BP 条件下被选中时,平均比最佳候选低 10.5 与 14.5 pp。
The effect comes almost entirely from point-masked deployment (1.84 pp); for block-masked deployment the loss is small and not significant. Candidate-level results suggest a mechanism: on point-masked tests MiniRocket-Ridge holds 84.0% of the oracle share, so departing from it is costly — and block-masked validation pushes selection away from MiniRocket towards 1NN-DTW and the Random Forest, which were 10.5 and 14.5 pp below the oracle when selected under BP.
换言之,这种不对称更可能取决于“最佳候选在各部署模式下有多集中”,而非点缺失或块缺失本身的固有性质。值得一提的是,块缺失测试本身要难得多:候选集的最佳平衡准确率在点缺失测试上为 81.5%,在块缺失测试上仅 70.4%,64 个数据集中有 62 个更低。
In other words, the asymmetry likely depends on how concentrated the best candidate is under each deployment pattern, rather than on an intrinsic property of point or block missingness. Note too that block-masked tests are much harder: the candidate-set oracle averaged 81.5% balanced accuracy on point-masked tests but only 70.4% on block-masked ones, lower on 62 of the 64 datasets.
06“换了”不等于“变差”A changed selection is not always a worse one
失配让约三分之一的配对选了不同的分类器,但在这些“换了”的配对里,失配的选择只有 58.3% 更差,37.3% 反而更好,4.4% 持平。在 5% 的缺失率下,约五分之一的配对换了选择,却没有可检测的性能损失。因此,研究分布偏移下的方法选择时,应报告配对的性能差或遗憾,而不只是“所选方法是否一致”。
Mismatch changed the selected classifier in about a third of pairs, but among those changed selections the mismatched choice was worse in only 58.3%, better in 37.3% and equal in 4.4%. At 5% missingness about one pair in five switched without any detectable loss. Studies of method selection under shift should therefore report paired performance differences or regret, not just agreement between selected methods.
07实践建议与局限Takeaways and limitations
- 匹配模式。若已知部署时的缺失模式,就用同样的模式遮蔽验证数据——尤其在中高缺失率下;5% 时差别不大。
- Match the pattern. If you know the deployment missingness pattern, mask validation data the same way — especially at moderate to high rates; at 5% it made little difference.
- 两种都试。若部署时可能出现成片缺口而验证集没有(或反之),在下定论前比较两种模式下的候选排名。
- Try both. If contiguous gaps may appear at deployment but not in validation (or vice versa), compare candidate rankings under both patterns before committing.
- 关注验证集规模。即使模式匹配,PP 条件下仍有 26.9% 的选择不是最优——验证集大小与重复验证对选择可靠性的影响值得单独研究。
- Mind the validation size. Even when matched, 26.9% of PP selections were suboptimal — the effect of validation-set size and repeated validation on selection reliability deserves its own study.
局限:仅比较了三个预先指定、超参数固定的候选;插补固定为线性插值;数据为 UCR2015 中 64 个单变量、等长、原本完整的数据集;缺失由受控的合成机制产生,并非模拟某种真实故障。结论应在这一受控设定下理解。
Limitations: only three pre-specified candidates with fixed hyperparameters; imputation fixed to linear interpolation; 64 univariate, equal-length, originally complete UCR2015 datasets; missingness generated by a controlled synthetic mechanism rather than a model of a specific real-world failure. The conclusions should be read within this controlled setting.