next up previous contents
Next: B.4.6 oldknn Up: B.4 Learners Previous: B.4.4 lr_cgmle   Contents


B.4.5 newknn

This is an implementation of a fast Ball-tree based Classifier with binary-valued input attributes. We rely on the fact that these two questions are not the same: (a)``Find me the $ k$ nearest neighbors.'' and (b) ``How many of the $ k$-nearest neighbors are in the positive class?'' Answering (b) exactly does not necessarily require us to answer (a).

newknn attacks the problem by building two ball trees: one ball tree is built from all the positive points in the dataset, another ball tree is built from all negative points. Then it is time to classify a new target point t, we compute $ q$, the number of k nearest neighbors of t that are in the positive class, in the following fashion:

We expect newknn can achieve a good speed up for the dataset with much more negative output than positive ones.




Keyword Arg Type Arg Vals Default
Common
k int [0,$ \infty$) 9
rmin int [1,$ \infty$) 5
mbw float [1e-7,$ \infty$) 0.01
     



Common keywords and arguments:


next up previous contents
Next: B.4.6 oldknn Up: B.4 Learners Previous: B.4.4 lr_cgmle   Contents
Copyright 2004 Paul Komarek, komarek@cmu.edu