[R] knn using custom distance metric

Liaw, Andy andy_liaw at merck.com
Sat Feb 7 03:55:55 CET 2004


What I have done is made a copy of the R and C functions, renamed them, and
modified the C code to compute the distance desired.  Very easy to do if you
know some C.

Andy

> From: Xiao-Jun Ma
> 
> Hi,
> 
> There are two packages providing knn classification: class 
> and knnTree.
> However, it seems both uses Eucleadian distances only. How 
> can I uses a
> custom distance function with either package?
> 
> Thanks,
> 
> Xiao-Jun
> 


------------------------------------------------------------------------------
Notice:  This e-mail message, together with any attachments,...{{dropped}}




More information about the R-help mailing list