We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello, I had old code written for Julia 1.0
using NearestNeighbors data = [[0.13380863416387367, 0.7845254987714512],[0.1563342025559629, 0.7956456895676077],[0.23320094627474594, 0.9055515160266435]] tree = KDTree(hcat(map(p -> [p[1], p[2]], data)...)) nearest, distance = knn(tree, [0.15, 0.8], 3, true, x -> x == 2)
In Julia 1.0, nearest is returned as [1, 3, 0], because 2 is skipped; in Julia 1.7.3, nearest is returned as [1, 3, 3], which seems not correct.
[1, 3, 0]
[1, 3, 3]
Packages status in Julia 1.0
[15f4f7f2] AutoHashEquals v0.2.0 [864edb3b] DataStructures v0.18.13 [c27321d9] Glob v1.3.0 [cd3eb016] HTTP v0.9.17 [7073ff75] IJulia v1.23.3 [6218d12a] ImageMagick v0.7.9 [02fcd773] ImageTransformations v0.8.13 [916415d5] Images v0.23.3 [b8a86587] NearestNeighbors v0.4.10
Packages statuses in Julia 1.7.3:
[15f4f7f2] AutoHashEquals v0.2.0 [864edb3b] DataStructures v0.18.13 [c27321d9] Glob v1.3.0 [cd3eb016] HTTP v0.9.17 [6218d12a] ImageMagick v1.2.1 [02fcd773] ImageTransformations v0.9.4 [916415d5] Images v0.25.2 [b8a86587] NearestNeighbors v0.4.10
So they are the same, except for IJulia, which should not be significant anyway
The text was updated successfully, but these errors were encountered:
It's a bit strange that the Julia version would change this... I'll try to figure out what changed.
Edit: Ah, it is a bounds error...
Sorry, something went wrong.
Can you try with #146?
Tried just now, this is the final output,
... julia> nearest, distance = knn(tree, [0.15, 0.8], 3, true, x -> x == 2) ([1, 3], [0.02239688629947563, 0.13440059522389006])
It is different from the original [1, 3, 0], but seems anyway correct to me (probably better, I have not to check for index 0).
Successfully merging a pull request may close this issue.
Hello, I had old code written for Julia 1.0
In Julia 1.0, nearest is returned as
[1, 3, 0]
, because 2 is skipped; in Julia 1.7.3, nearest is returned as[1, 3, 3]
, which seems not correct.Packages status in Julia 1.0
Packages statuses in Julia 1.7.3:
So they are the same, except for IJulia, which should not be significant anyway
The text was updated successfully, but these errors were encountered: