Compute cosine distance.
(self, x: npt.NDArray)
| 216 | self._vectors = normalize_or_copy(self._vectors) |
| 217 | |
| 218 | def _dist(self, x: npt.NDArray) -> npt.NDArray: |
| 219 | """Compute cosine distance.""" |
| 220 | x_norm = normalize(x) |
| 221 | sim = x_norm.dot(self._vectors.T) |
| 222 | return 1 - sim |
| 223 | |
| 224 | def insert(self, vectors: npt.NDArray) -> None: |
| 225 | """Insert vectors into the vector space.""" |
nothing calls this directly
no test coverage detected