[R] Nearest Neighbor Algorithm in R -- again.

Hans W Borchers Venherm.Borchers at t-online.de
Tue Feb 3 07:41:24 CET 2004


> /Why not modify the C code of knn? (Not knn1)/

Because I thought it would not be a good idea to apply 'knn' a 1000
times or more.

Instead I was looking for a procedure that returns a structure making
it easy to find nearest neighbors for any point one wants. This way I
used 'dist' for smaller data sets.

The next step could be to extent nearest neighbors to data frames with
factors generalizing, for example, the 'daisy' function.

But you might be right that looking at the 'knn' implementation will
be a faster road for the moment.

Hans Werner Borchers
ABB Corporate Research, Germany




More information about the R-help mailing list