MCPcopy Create free account
hub / github.com/antgroup/vsag / CalRecall

Method CalRecall

tests/python/test_base.py:48–52  ·  view source on GitHub ↗

Calculate recall for testing

(results: np.ndarray, gt_ids: np.ndarray, topk: int = 10)

Source from the content-addressed store, hash-verified

46
47 @staticmethod
48 def CalRecall(results: np.ndarray, gt_ids: np.ndarray, topk: int = 10) -> float:
49 """Calculate recall for testing"""
50 # too many indices for array: array is 1-dimensional, but 2 were indexed
51 recall = np.isin(results[:topk], gt_ids[:topk]).sum(axis=0)
52 return recall / topk
53
54 @staticmethod
55 def GenerateRandomFilePath() -> str:

Callers 1

TestKnnSearchMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected