-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom metric gives error #257
Comments
Ok, I figured this out alone.. Documenting for anyone elese exepriencing this
fixed it |
As it says (I understand that we are not very good spelling out the requirements upfront): you need to define another method that deals with the "scalar" case: (::MyMetric)(a::Float64, b::Float64) = abs(a - b) This is required for the determination of the target eltype. Note that your example is the squared Euclidean distance. Which means that integer vectors yield an integer distance. If you want the Euclidean distance (just to demonstrate the reasoning), you should take the square root in your vector-method, and perhaps define (::MyMetric)(a::Float64, b::Float64) = float(a - b) |
This issue should be closed. The above answers are good! Thank you. I did |
Trying a simple custom metric (which is just euclidian distan)
I'm getting
Any idea what am I missing ?
The text was updated successfully, but these errors were encountered: