Re: knn in c

作者: mercurial (多變)   2005-03-30 14:17:02
※ 引述《rafan (@_@"""")》之銘言:
: I did a simple test for KNN written in C.
: testing 100 points with 520000 training needs about 61sec
: with optimization it can be done in 31sec (k = 9)
: (-O -mcpu=pentium4)
: in that sense, 5-cv + testing can be done in 50 hours if
: optimized. Otherwise, seems it needs 100 hours or so.
A package called "fields" in R can compute Euclidean distance of
two matrix.
rdist() calls another underlying Fortran function to compute.
Another function called rdist.S() is pure R function.
rdist.S() is much slower than rdist().
You may try to compare C with this.

Links booklink

Contact Us: admin [ a t ] ucptt.com