Reference¶
vector_search_study.reference ¶
High-accuracy trusted reference for exact vector search.
reference_search ¶
reference_search(
corpus: FloatMatrix,
queries: FloatMatrix,
k: int,
*,
objective: SearchObjective
| str = SearchObjective.NORMALIZED_COSINE,
) -> SearchResult
Compute canonical exact top-k results with accurate scalar summation.
This intentionally slow implementation is designed for correctness tests and untimed benchmark validation, not performance measurement.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
corpus
|
FloatMatrix
|
Corpus matrix with shape |
required |
queries
|
FloatMatrix
|
Query matrix with shape |
required |
k
|
int
|
Number of ordered neighbors to return. |
required |
objective
|
SearchObjective | str
|
Exact-search score convention. |
NORMALIZED_COSINE
|
Returns:
| Type | Description |
|---|---|
SearchResult
|
Canonically ordered exact results. |
Raises:
| Type | Description |
|---|---|
InvalidVectorDataError
|
If corpus and query contracts do not match. |
Source code in src/vector_search_study/reference.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | |