I am using the k-nearest neighbor classifier on weka (http://weka.sourceforge.net/doc.dev/weka/classifiers/lazy/IBk.html).
I suppose the Euclidean distance is the default distance function. How could I change that function and use the same class with my own distance function?
Thanks,
Marco
IBk.getNearestNeighbourSearchAlgorithm().setDistanceFunction()
seems to be what you need.
Check out http://weka.sourceforge.net/doc.dev/weka/core/DistanceFunction.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With