Efficient Task-Specific Data Valuation for Nearest Neighbor Algorithms

Given a data set containing millions of data points and a data consumer who is willing to pay for \X\mathcal{D}, how should we distribute this \ to each data point to reflect its "value"? In this paper, we define the "relative value of data" via the Shapley value, as it uniquely possesses properties with appealing real-world interpretations, such as fairness, rationality and decentralizability. For general, bounded utility functions, the Shapley value is known to be challenging to compute: to get Shapley values for all data points, it requires model evaluations for exact computation and for -approximation. In this paper, we focus on one popular family of ML models relying on -nearest neighbors (NN). The most surprising result is that for unweighted NN classifiers and regressors, the Shapley value of all data points can be computed, exactly, in time -- an exponential improvement on computational complexity! Moreover, for -approximation, we are able to develop an algorithm based on Locality Sensitive Hashing (LSH) with only sublinear complexity when is not too small and is not too large. We empirically evaluate our algorithms on up to million data points and even our exact algorithm is up to three orders of magnitude faster than the baseline approximation algorithm. The LSH-based approximation algorithm can accelerate the value calculation process even further. We then extend our algorithms to other scenarios such as (1) weighed NN classifiers, (2) different data points are clustered by different data curators, and (3) there are data analysts providing computation who also requires proper valuation.
View on arXiv