scikitplot.annoy#
High-level Python interface for the C++ Annoy backend.
Spotify Annoy (Approximate Nearest Neighbors Oh Yeah).
Exports:
Annoy → low-level C-extension type (stable)
AnnoyBase → alias of annoylib.Annoy Index
Index → high-level Python subclass (picklable)
AnnoyIndex → public aliases of Annoy Index
Note
See also
References
Examples
>>> # from annoy import AnnoyIndex
>>> from scikitplot.annoy import Annoy, AnnoyBase, AnnoyIndex, Index
>>> f = 40 # vector dimensionality
>>> t = AnnoyIndex(f, "angular") # Length of item vector and metric
>>> t.add_item(0, [1] * f)
>>> t.build(10) # Build 10 trees
>>> t.get_nns_by_item(0, 1) # Find nearest neighbor
User guide. See the ANNoy section for further details.
ANNoy (Approximate Nearest Neighbors Oh Yeah)#
ANNoy Mixins#
Export/import metadata only. |
|
Persistence for the Python object (Index/Annoy alias), not the raw Annoy index file. |
|
Thin Python subclass that tracks the last known on-disk path. |
|
Adds strict persistence support. |