Nearest neighbor (NN) methods have re-emerged as competitive tools for matrix completion, offering strong empirical performance and recent theoretical guarantees, including entry-wise error bounds, confidence intervals, and minimax optimality. Despite their simplicity, recent work has shown that NN approaches are robust to a range of missingness patterns and effective across diverse applications. This paper introduces N$^2$, a unified Python package and testbed that consolidates a broad class of NN-based methods through a modular, extensible interface. Built for both researchers and practitioners, N$^2$ supports rapid experimentation and benchmarking. Using this framework, we introduce a new NN variant that achieves state-of-the-art results in several settings. We also release a benchmark suite of real-world datasets, from healthcare and recommender systems to causal inference and LLM evaluation, designed to stress-test matrix completion methods beyond synthetic scenarios. Our experiments demonstrate that while classical methods excel on idealized data, NN-based techniques consistently outperform them in real-world settings.
翻译:最近邻(NN)方法已重新成为矩阵补全的有力工具,展现出强大的实证性能,并获得了包括逐项误差界、置信区间和极小极大最优性在内的最新理论保证。尽管方法简单,近期研究表明,NN方法对多种缺失模式具有鲁棒性,并在不同应用中均表现有效。本文介绍N$^2$,一个通过模块化、可扩展接口整合了广泛类别基于NN方法的统一Python包与测试平台。N$^2$面向研究人员和从业者设计,支持快速实验与基准测试。利用该框架,我们提出了一种新的NN变体,在多种设定下取得了最先进的结果。我们还发布了一套涵盖医疗健康、推荐系统、因果推断及大语言模型评估等领域的真实世界数据集基准测试集,旨在对矩阵补全方法进行超越合成场景的压力测试。实验结果表明,尽管经典方法在理想化数据上表现优异,基于NN的技术在真实世界设定中始终优于它们。