IDEAS home Printed from https://ideas.repec.org/a/spr/metcap/v21y2019i4d10.1007_s11009-018-9670-z.html
   My bibliography  Save this article

An Efficient Algorithm for Bayesian Nearest Neighbours

Author

Listed:
  • Giuseppe Nuti

    (University College London)

Abstract

K-Nearest Neighbours (k-NN) is a popular classification and regression algorithm, yet one of its main limitations is the difficulty in choosing the number of neighbours. We present a Bayesian algorithm to compute the posterior probability distribution for k given a target point within a data-set, efficiently and without the use of Markov Chain Monte Carlo (MCMC) methods or simulation—alongside an exact solution for distributions within the exponential family. The central idea is that data points around our target are generated by the same probability distribution, extending outwards over the appropriate, though unknown, number of neighbours. Once the data is projected onto a distance metric of choice, we can transform the choice of k into a change-point detection problem, for which there is an efficient solution: we recursively compute the probability of the last change-point as we move towards our target, and thus de facto compute the posterior probability distribution over k. Applying this approach to both a classification and a regression UCI data-sets, we compare favourably and, most importantly, by removing the need for simulation, we are able to compute the posterior probability of k exactly and rapidly. As an example, the computational time for the Ripley data-set is a few milliseconds compared to a few hours when using a MCMC approach.

Suggested Citation

  • Giuseppe Nuti, 2019. "An Efficient Algorithm for Bayesian Nearest Neighbours," Methodology and Computing in Applied Probability, Springer, vol. 21(4), pages 1251-1258, December.
  • Handle: RePEc:spr:metcap:v:21:y:2019:i:4:d:10.1007_s11009-018-9670-z
    DOI: 10.1007/s11009-018-9670-z
    as

    Download full text from publisher

    File URL: http://link.springer.com/10.1007/s11009-018-9670-z
    File Function: Abstract
    Download Restriction: Access to the full text of the articles in this series is restricted.

    File URL: https://libkey.io/10.1007/s11009-018-9670-z?utm_source=ideas
    LibKey link: if access is restricted and if your library uses this service, LibKey will redirect you to where you can use your library subscription to access this item
    ---><---

    As the access to this document is restricted, you may want to search for a different version of it.

    References listed on IDEAS

    as
    1. D. A. Stephens, 1994. "Bayesian Retrospective Multiple‐Changepoint Identification," Journal of the Royal Statistical Society Series C, Royal Statistical Society, vol. 43(1), pages 159-178, March.
    2. Ghosh, Anil K., 2006. "On optimum choice of k in nearest neighbor classification," Computational Statistics & Data Analysis, Elsevier, vol. 50(11), pages 3113-3123, July.
    3. C. C. Holmes & N. M. Adams, 2002. "A probabilistic nearest neighbour method for statistical pattern recognition," Journal of the Royal Statistical Society Series B, Royal Statistical Society, vol. 64(2), pages 295-306, May.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Yinglei Lai & Baolin Wu & Hongyu Zhao, 2011. "A permutation test approach to the choice of size k for the nearest neighbors classifier," Journal of Applied Statistics, Taylor & Francis Journals, vol. 38(10), pages 2289-2302.
    2. Ha-Thu Nguyen, 2015. "How is credit scoring used to predict default in China?," EconomiX Working Papers 2015-1, University of Paris Nanterre, EconomiX.
    3. Lu Shaochuan, 2020. "Bayesian multiple changepoints detection for Markov jump processes," Computational Statistics, Springer, vol. 35(3), pages 1501-1523, September.
    4. Manahov, Viktor & Hudson, Robert & Gebka, Bartosz, 2014. "Does high frequency trading affect technical analysis and market efficiency? And if so, how?," Journal of International Financial Markets, Institutions and Money, Elsevier, vol. 28(C), pages 131-157.
    5. Daudin, Jean-Jacques & Mary-Huard, Tristan, 2008. "Estimation of the conditional risk in classification: The swapping method," Computational Statistics & Data Analysis, Elsevier, vol. 52(6), pages 3220-3232, February.
    6. Sadaf Kabir & Leily Farrokhvar, 2022. "Non-linear missing data imputation for healthcare data via index-aware autoencoders," Health Care Management Science, Springer, vol. 25(3), pages 484-497, September.
    7. Chiara Lattanzi & Manuele Leonelli, 2019. "A changepoint approach for the identification of financial extreme regimes," Papers 1902.09205, arXiv.org.
    8. Santitissadeekorn, Naratip & Lloyd, David J.B. & Short, Martin B. & Delahaies, Sylvain, 2020. "Approximate filtering of conditional intensity process for Poisson count data: Application to urban crime," Computational Statistics & Data Analysis, Elsevier, vol. 144(C).
    9. Laha, A. K. & Rathi, Poonam, 2017. "New Approaches to Prediction using Functional Data Analysis," IIMA Working Papers WP 2017-08-02, Indian Institute of Management Ahmedabad, Research and Publication Department.
    10. Seong W. Kim & Sabina Shahin & Hon Keung Tony Ng & Jinheum Kim, 2021. "Binary segmentation procedures using the bivariate binomial distribution for detecting streakiness in sports data," Computational Statistics, Springer, vol. 36(3), pages 1821-1843, September.
    11. Lindeløv, Jonas Kristoffer, 2020. "mcp: An R Package for Regression With Multiple Change Points," OSF Preprints fzqxv, Center for Open Science.
    12. repec:cup:judgdm:v:13:y:2018:i:6:p:622-635 is not listed on IDEAS
    13. D Briand & A V Huzurbazar, 2008. "Bayesian reliability applications of a combined lifecycle failure distribution," Journal of Risk and Reliability, , vol. 222(4), pages 713-720, December.
    14. Li, Jing & Gao, Fei & Lin, Song & Guo, Mingchao & Li, Yongmei & Liu, Hailing & Qin, Sujuan & Wen, QiaoYan, 2023. "Quantum k-fold cross-validation for nearest neighbor classification algorithm," Physica A: Statistical Mechanics and its Applications, Elsevier, vol. 611(C).
    15. Jing Quan & Xuelian Sun, 2024. "Credit risk assessment using the factorization machine model with feature interactions," Palgrave Communications, Palgrave Macmillan, vol. 11(1), pages 1-10, December.
    16. Ardia, David & Dufays, Arnaud & Ordás Criado, Carlos, 2023. "Linking Frequentist and Bayesian Change-Point Methods," MPRA Paper 119486, University Library of Munich, Germany.
    17. Michael D. Lee, 2018. "Bayesian methods for analyzing true-and-error models," Judgment and Decision Making, Society for Judgment and Decision Making, vol. 13(6), pages 622-635, November.
    18. Adam Check & Jeremy Piger, 2021. "Structural Breaks in U.S. Macroeconomic Time Series: A Bayesian Model Averaging Approach," Journal of Money, Credit and Banking, Blackwell Publishing, vol. 53(8), pages 1999-2036, December.
    19. Arnaud Dufays & Zhuo Li & Jeroen V.K. Rombouts & Yong Song, 2021. "Sparse change‐point VAR models," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 36(6), pages 703-727, September.
    20. Simon C. Smith, 2020. "Equity premium prediction and structural breaks," International Journal of Finance & Economics, John Wiley & Sons, Ltd., vol. 25(3), pages 412-429, July.
    21. Subhajit Dutta & Anil K. Ghosh, 2017. "Discussion," International Statistical Review, International Statistical Institute, vol. 85(1), pages 40-43, April.

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:spr:metcap:v:21:y:2019:i:4:d:10.1007_s11009-018-9670-z. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: Sonal Shukla or Springer Nature Abstracting and Indexing (email available below). General contact details of provider: http://www.springer.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.