Newsgroups: comp.ai.neural-nets,sci.stat.math
Path: cantaloupe.srv.cs.cmu.edu!rochester!udel-eecis!news.mathworks.com!zombie.ncsc.mil!newsgate.duke.edu!interpath!news.interpath.net!sas!newshost.unx.sas.com!saswss
From: saswss@hotellng.unx.sas.com (Warren Sarle)
Subject: Re: K-nearest neighbors
Originator: saswss@hotellng.unx.sas.com
Sender: news@unx.sas.com (Noter of Newsworthy Events)
Message-ID: <DvA2GJ.5yD@unx.sas.com>
Date: Sun, 28 Jul 1996 23:55:30 GMT
X-Nntp-Posting-Host: hotellng.unx.sas.com
References: <4tdcms$im7@news.wco.com> <4tfgsc$mkc@sjx-ixn4.ix.netcom.com>
Organization: SAS Institute Inc.
Lines: 18
Xref: glinda.oz.cs.cmu.edu comp.ai.neural-nets:32750 sci.stat.math:11738


In article <4tfgsc$mkc@sjx-ixn4.ix.netcom.com>, jdadson@ix.netcom.com(Jive Dadson) writes:
|> Speaking of K-nearest neighbors, what is the most efficient way
|> to find them? I use a KD-tree to find training data within a given
|> sigma of a datum. I could make a list of sigmas. Sigma[i] would
|> be the distance from training data[i] to its Kth-nearest. Then
|> I could use the KD routine as before. But I can't think of any fast way
|> to make the list. ...

While traversing the KD-tree, keep a list of the K nearest neighbors
in a priority queue. See Knuth or various other computer science texts
for details on priority queues.

-- 

Warren S. Sarle       SAS Institute Inc.   The opinions expressed here
saswss@unx.sas.com    SAS Campus Drive     are mine and not necessarily
(919) 677-8000        Cary, NC 27513, USA  those of SAS Institute.
