New Algorithm Provides Exact Data Shapley for Weighted KNN Regression

Zongye Lyu· July 15, 2026 View original

Summary

Researchers have developed the first pseudo-polynomial-time exact algorithm for Data Shapley values in weighted k-nearest-neighbor (KNN) regression and soft-label prediction, addressing a long-standing computational challenge. This new method offers deterministic, certified error bounds, providing a reliable ground truth for auditing data valuation estimators.

Data Shapley is a crucial method for determining the value of individual data points in a training set, particularly its k-nearest-neighbor (KNN) variant used in practical toolkits. While exact algorithms existed for unweighted KNN and weighted KNN classification, weighted KNN regression and soft-label prediction remained computationally challenging, previously requiring an exponential brute-force approach. This difficulty stemmed from the complex, coalition-dependent ratio involved in weighted regression predictions, which broke the additive structures leveraged by prior polynomial algorithms. A new breakthrough introduces the first pseudo-polynomial-time exact algorithm for weighted KNN-regression Data Shapley. This method, based on a counting dynamic program, has been rigorously verified against exhaustive enumeration. Additionally, the research provides a certified Fully Polynomial-Time Approximation Scheme (FPTAS) for continuous weights and targets, complete with machine-checkable error certificates. The findings also include a complexity landscape analysis and a weighted soft-label multi-class extension. An open-source, CPU-only library has been released, offering the first exact weighted-regression Data Shapley ground truth. While Monte-Carlo Data Shapley showed statistical equivalence for downstream mislabel detection, the exact method provides determinism and a certified error bound, proving invaluable for auditing and ensuring precise data point ranking.

Why it matters

Professionals can now precisely quantify the contribution of individual data points in complex machine learning models, improving data quality assessment, model interpretability, and fairness. This enables more reliable auditing of data valuation and better decision-making regarding data acquisition and retention.

How to implement this in your domain

  1. 1Integrate the new open-source library into existing data valuation pipelines to calculate exact Data Shapley values.
  2. 2Utilize the certified error bounds to validate the reliability of data point contributions in critical applications.
  3. 3Employ the exact Data Shapley values to identify and remove low-value or noisy data, enhancing model performance and efficiency.
  4. 4Audit current Monte-Carlo based Data Shapley estimators against this new ground truth to assess their accuracy and ranking consistency.
  5. 5Apply the method to identify influential data points for targeted data augmentation or correction strategies.

Who benefits

HealthcareFinanceE-commerceAI/ML DevelopmentData Science

Key takeaways

  • An exact algorithm for weighted KNN regression Data Shapley is now available, overcoming previous computational barriers.
  • This method provides deterministic data valuation with certified error bounds, crucial for auditing and reliability.
  • The open-source library allows practitioners to implement precise data point contribution analysis.
  • Exact Data Shapley offers superior ranking consistency compared to Monte-Carlo approximations, aiding data quality efforts.

Original post by Zongye Lyu

"arXiv:2607.11956v1 Announce Type: new Abstract: Data Shapley is the standard principled answer to which training points are worth what, and its k-nearest-neighbor (KNN) specialization is the version deployed in practice: the exact estimator shipped by toolkits such as pyDVL and O…"

View on X

Originally posted by Zongye Lyu on X · view source

Want to go deeper?

Turn these trends into skills with Learnijoy's hands-on AI & tech courses.

Explore courses