BruteTree SemiMetric support
zgornel opened this issue · comments
Corneliu Cofaru commented
BruteTree
s are a simple structure that can support ::Distances.SemiMetric
. Is there any reason for which these are not allowed? Im obviously referring to the cosine distance which is a very popular choice in many applications.
A minimal example would be:
bt = BruteTree(rand(2,10), CosineDist()) # currently fails
idxs, dists = knn(bt, rand(2))
A - quickly found - reference regarding kdtrees.