TL;DR
This paper introduces $N^2$, a unified Python package and benchmark suite for nearest neighbor (NN) methods applied to matrix completion. It aims to simplify experimentation and benchmarking of these increasingly competitive algorithms, demonstrating their superior performance on real-world data compared to traditional methods.
What Problem Does This Paper Address?
Matrix completion, the task of filling in missing entries in a data matrix, is a fundamental problem with applications ranging from recommender systems to healthcare. While traditional methods like low-rank matrix factorization have been dominant, nearest neighbor (NN) approaches have recently shown strong empirical performance and theoretical guarantees, particularly in handling complex, real-world data with various missingness patterns. However, the landscape of NN methods for matrix completion is fragmented, with different algorithms and implementations scattered across various research papers. This makes it difficult for researchers and practitioners to easily compare, experiment with, and extend these methods. The paper addresses this by providing a unified framework and a comprehensive benchmark to democratize the use and development of NN-based matrix completion techniques.
Methods
The core of the $N^2$ package is built around two abstract classes: EstimationMethod and DataType. This design allows for flexibility and extensibility, enabling users to easily plug in new algorithms or data types. The framework abstracts the estimation procedure, separating it from the specific data representation.
The paper details how various NN methods are implemented using two general modules: DISTANCE and AVERAGE. These modules handle calculating distances between data points and computing weighted averages, respectively. The paper then elaborates on specific NN variants, including:
- Scalar Nearest Neighbors: RowNN, CoINN, TSNN, DRNN, and AutoNN. These methods are designed for scalar-valued entries in the matrix.
- Distributional Nearest Neighbors: KernelNN and W2NN. These methods handle entries that represent distributions, using metrics like Maximum Mean Discrepancy (MMD) and Wasserstein distance.
- Adaptively Weighted Nearest Neighbors: AWNN, which dynamically adjusts weights to balance bias-variance trade-offs.
The paper also introduces a new NN variant (not explicitly named but demonstrated to achieve state-of-the-art results) within this framework.
Datasets
The paper introduces $N^2$-Bench, a benchmark suite comprising real-world datasets from diverse domains:
- Personalized healthcare: HeartSteps V1 study data, used for estimating counterfactual outcomes.
- Recommender systems: MovieLens 1M dataset, a standard benchmark for matrix completion.
- Causal inference: Proposition 99 dataset, for estimating the effect of a tobacco tax on cigarette consumption.
- LLM evaluation: PromptEval dataset, used to evaluate large language models by estimating their performance distributions across tasks and models.
The paper also mentions synthetic data generation for controlled experiments.
Key Insights and Ideas
- Real-world data is messy: Classical matrix completion methods perform well on idealized, synthetic data but struggle with the complex missingness patterns and noise found in real-world applications.
- NNs excel in the wild: Nearest neighbor methods, particularly distributional ones, consistently outperform classical and even scalar NN methods on real-world datasets across various domains.
- Unified framework is crucial: A modular and extensible package like $N^2$ is essential for accelerating research and adoption of NN-based matrix completion, allowing easy comparison and extension of algorithms.
- Distributional methods capture nuance: Matching by distributions, rather than just their first moments (means), allows NN methods to capture richer data structures (e.g., bimodality) and achieve better imputation accuracy.
Key Results
- The $N^2$ package successfully unifies a broad class of NN-based matrix completion algorithms.
- Experiments on HeartSteps V1 data showed distributional NN methods (KernelNN, W2NN) significantly outperforming scalar methods and baselines in estimating step counts.
- On the MovieLens dataset, NN methods achieved lower average error and standard deviation compared to USVT, with some methods performing on par with SoftImpute. Notably, they performed well even when trained on a small subset of the data.
- For the Proposition 99 dataset, NN methods like TSNN and RowNN achieved comparable results to gold-standard synthetic control methods in estimating counterfactual cigarette consumption, often with less information.
- In the LLM evaluation setting, distributional NN methods demonstrated the ability to recover underlying performance distributions even with substantial missingness (up to 30% missing entries).
Limitations and Future Work
- Runtime: The authors plan to speed up the runtime of $N^2$, especially for commonly used scalar-valued matrices.
- Scalability: Future work includes adding support for distributed datasets that are too large to fit into memory.
- Algorithm Extension: The library aims to extend to other NN algorithms, such as approximate nearest neighbors and methods that incorporate linear regression instead of simple averaging.
- Doubly Robust Estimators: The paper notes that doubly robust estimators do not work out-of-the-box with distributions because a subtraction operation is not well-defined in the distribution space.
Summary updated