Skip to content

Commit

Permalink
Add a test for custom metric on BruteKNN
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed May 14, 2024
1 parent f358b24 commit 582b220
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/scholar/neighbors/brute_knn_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,10 @@ defmodule Scholar.Neighbors.BruteKNNTest do

assert distances_pred == distances_true
end

test "custom metric" do
model = BruteKNN.fit(data(), num_neighbors: 3, batch_size: 1, metric: :cosine)
assert {_, _} = BruteKNN.predict(model, query())
end
end
end

0 comments on commit 582b220

Please sign in to comment.