Annoy#
- class scikitplot.cexternals.annoy.Annoy#
- Compiled on GCC. Using 512-bit AVX instructions. - add_item()#
- Adds item - i(any nonnegative integer) with vector- v.- Note that it will allocate memory for - max(i)+1items.
 - build()#
- Builds a forest of - n_treestrees.- More trees give higher precision when querying. After calling - build, no more items can be added.- n_jobsspecifies the number of threads used to build the trees.- n_jobs=-1uses all available CPU cores.
 - f#
- !! processed by numpydoc !! 
 - get_distance()#
- Returns the distance between items - iand- j.
 - get_item_vector()#
- Returns the vector for item - ithat was previously added.
 - get_n_items()#
- Returns the number of items in the index. 
 - get_n_trees()#
- Returns the number of trees in the index. 
 - get_nns_by_item()#
- Returns the - nclosest items to item- i.- Parameters:
- search_k – the query will inspect up to - search_knodes.
 - search_kgives you a run-time tradeoff between better accuracy and speed.- search_kdefaults to- n_trees * nif not provided.- Parameters:
- include_distances – If - True, this function will return a
 - 2 element tuple of lists. The first list contains the - nclosest items. The second list contains the corresponding distances.
 - get_nns_by_vector()#
- Returns the - nclosest items to vector- vector.- Parameters:
- search_k – the query will inspect up to - search_knodes.
 - search_kgives you a run-time tradeoff between better accuracy and speed.- search_kdefaults to- n_trees * nif not provided.- Parameters:
- include_distances – If - True, this function will return a
 - 2 element tuple of lists. The first list contains the - nclosest items. The second list contains the corresponding distances.
 - load()#
- Loads (mmaps) an index from disk. 
 - on_disk_build()#
- Build will be performed with storage on disk instead of RAM. 
 - save()#
- Saves the index to disk. 
 - set_seed()#
- Sets the seed of Annoy’s random number generator. 
 - unbuild()#
- Unbuilds the tree in order to allows adding new items. - build() has to be called again afterwards in order to run queries. 
 - unload()#
- Unloads an index from disk. 
 - verbose()#
 
