Why is weka's KNN implementation faster?

1) As we know, KNN does not perform any calculations at the training stage, and does not postpone all calculations for classification, because of which we call it a lazy student. It will take more time in classification than training, however I found this assumption to be almost the opposite with respect to weka. In which KNN takes longer in training than testing.

Why and how does KNN in weka perform much faster in classification, whereas in general should it perform slower?

Does this also lead to a calculation error?

2) When we say that the function of weights in Knn can improve performance for high-size data, what do we mean by that? Do we mean the choice of functions and the selection function with a high information resource?

+4
source share
1 answer

Answer to question 1

I assume that the Weka implementation uses some data structure to efficiently execute (approximate) queries of the closest neighbor.

Using such data structures, queries can be performed much more efficiently than executing them in a naive way.

Examples of such data structures are the KD tree and the SR tree .

At the training stage, a data structure must be created, so it will take more time than classification.

Answer to question 2

( , , . , .)

.

. - ( ) . , .

, , , . , . TF-IDF .

+4

Source: https://habr.com/ru/post/1526743/


All Articles