How to use another remote measure for k-nearest neighbor in Java / Weka?

I use the k-closest neighbor classifier on weka (http://weka.sourceforge.net/doc.dev/weka/classifiers/lazy/IBk.html).

I believe that Euclidean distance is a function of the default distance. How can I change this function and use the same class with my own distance function?

Thanks,

Marco

+6
source share
2 answers

IBk.getNearestNeighbourSearchAlgorithm().setDistanceFunction() looks like what you need.

Check out http://weka.sourceforge.net/doc.dev/weka/core/DistanceFunction.html

+4
source

At first,

select ibk under lazy. Click on ibk. On the ibk details page, click on the algorithm in the nearest neighbor search algorithm section, edit the distance function section on the screen.

0
source

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


All Articles