mirror of
https://github.com/nosqlbench/nosqlbench.git
synced 2025-01-26 15:36:33 -06:00
update recall relevant set
This commit is contained in:
parent
aa88c22a2c
commit
469985de6e
@ -61,6 +61,7 @@ public class ComputeFunctions {
|
||||
if (actual.length < k) {
|
||||
throw new RuntimeException("indices fewer than limit, invalid precision computation: index count=" + actual.length + ", limit=" + k);
|
||||
}
|
||||
relevant = Arrays.copyOfRange(relevant,0,k);
|
||||
actual = Arrays.copyOfRange(actual, 0, k);
|
||||
Arrays.sort(relevant);
|
||||
Arrays.sort(actual);
|
||||
@ -106,6 +107,7 @@ public class ComputeFunctions {
|
||||
if (actual.length < k) {
|
||||
throw new RuntimeException("indices fewer than limit, invalid precision computation: index count=" + actual.length + ", limit=" + k);
|
||||
}
|
||||
relevant = Arrays.copyOfRange(relevant,0,k);
|
||||
actual = Arrays.copyOfRange(actual, 0, k);
|
||||
Arrays.sort(relevant);
|
||||
Arrays.sort(actual);
|
||||
|
@ -69,7 +69,7 @@ class ComputeFunctionsIntTest {
|
||||
public void sanityCheckRecallAndLimitRatio() {
|
||||
int[] hundo = IntStream.range(0,100).toArray();
|
||||
|
||||
for (int i = 0; i < hundo.length; i++) {
|
||||
for (int i = 1; i < hundo.length; i++) {
|
||||
int[] partial=IntStream.range(0,i).toArray();
|
||||
int finalI = i;
|
||||
assertThat(ComputeFunctions.recall(hundo, partial))
|
||||
@ -77,7 +77,7 @@ class ComputeFunctionsIntTest {
|
||||
.isCloseTo((double)partial.length/(double)hundo.length,offset);
|
||||
assertThat(ComputeFunctions.recall(hundo, hundo, i))
|
||||
.as(() -> "for full intersection, limit " + finalI +" (K) recall should be fractional/100")
|
||||
.isCloseTo((double)partial.length/(double)hundo.length,offset);
|
||||
.isCloseTo(1.0d,offset);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user