Skip to content

Commit 9471c57

Browse files
Make the thresholds in TestLowCardinalityFiltering tighter (#559)
Reduce the number of vectors in TestLowCardinalityFiltering and adjust the thresholds to make them tighter
1 parent 21e4a22 commit 9471c57

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

jvector-tests/src/test/java/io/github/jbellis/jvector/graph/TestLowCardinalityFiltering.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,19 @@
4545

4646
@ThreadLeakScope(ThreadLeakScope.Scope.NONE)
4747
public class TestLowCardinalityFiltering extends LuceneTestCase {
48+
/*
49+
This test replicates https://github.com/jbellis/pwtest/tree/master natively in JVector.
50+
It splits the vectors in two classes (with probability 0.5) and tests that the filtering works when the query belongs to one of them.
51+
*/
4852
@Test
4953
public void testLowCardinalityFiltering() throws IOException {
50-
testLowCardinalityFiltering(32, 0.01f, 0.87f, false);
51-
testLowCardinalityFiltering(32, 0.01f, 0.87f, true);
54+
testLowCardinalityFiltering(32, 0.044f, 0.91f, false);
55+
testLowCardinalityFiltering(32, 0.048f, 0.93f, true);
5256
}
5357
public void testLowCardinalityFiltering(int maxDegree, float visitedRatioThreshold, float recallThreshold, boolean addHierarchy) throws IOException {
5458
var R = getRandom();
5559

56-
int nVectors = 100_000;
60+
int nVectors = 10_000;
5761
int nQueries = 100;
5862
int dimensions = 16;
5963
int topK = 10;

0 commit comments

Comments
 (0)