# Detecting Dataset Drift and Non-IID Sampling via k-Nearest Neighbors

arXiv: https://arxiv.org/abs/2305.15696 · HTML: https://mlsanity.com/paper/2305.15696/

## Key facts

- No citing papers in the map yet (data through 14 Oct 2026).
- Builds on 6 of its 31 references that are in the map.
- First posted on arXiv 25 May 2023.

## Builds on (most cited first, 6 of 6)

- [Deep Residual Learning for Image Recognition](https://mlsanity.com/paper/1512.03385/) (2015)
- [Federated Learning with Non-IID Data](https://mlsanity.com/paper/1806.00582/) (2018)
- [The Non-IID Data Quagmire of Decentralized Machine Learning](https://mlsanity.com/paper/1910.00189/) (2019)
- [Characterizing Concept Drift](https://mlsanity.com/paper/1511.03816/) (2015)
- [A Review of Self-Exciting Spatio-Temporal Point Processes and Their Applications](https://mlsanity.com/paper/1708.02647/) (2017)
- [Modeling Persistent Trends in Distributions](https://mlsanity.com/paper/1511.04486/) (2015)

## Abstract (arXiv)

We present a straightforward statistical test to detect certain violations of the assumption that the data are Independent and Identically Distributed (IID). The specific form of violation considered is common across real-world applications: whether the examples are ordered in the dataset such that almost adjacent examples tend to have more similar feature values (e.g. due to distributional drift, or attractive interactions between datapoints). Based on a k-Nearest Neighbors estimate, our approach can be used to audit any multivariate numeric data as well as other data types (image, text, audio, etc.) that can be numerically represented, perhaps with model embeddings. Compared with existing methods to detect drift or auto-correlation, our approach is both applicable to more types of data and also able to detect a wider variety of IID violations in practice. Code: https://github.com/cleanlab/cleanlab
