Skip to content

Commit f0b6b10

Browse files
committed
Tested metric support for Elkan
1 parent 8168acb commit f0b6b10

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/elkan.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,13 @@ function chunk_update_bounds(alg, containers, centroids, metric::Metric, r, idx)
284284
stale = containers.stale
285285
labels = containers.labels
286286
T = eltype(centroids)
287-
# TODO: Update the metric support for non eucledian metric
287+
288288
@inbounds for i in r
289289
for j in axes(centroids, 2)
290-
lb[j, i] = lb[j, i] > p[j] ? lb[j, i] + p[j] - T(2)*sqrt(abs(lb[j, i]*p[j])) : zero(T)
290+
lb[j, i] = lb[j, i] > p[j] ? lb[j, i] - p[j] : zero(T)
291291
end
292292
stale[i] = true
293-
ub[i] += p[labels[i]] + T(2)*sqrt(abs(ub[i]*p[labels[i]]))
293+
ub[i] += p[labels[i]]
294294
end
295-
end
295+
296+
end

0 commit comments

Comments
 (0)