select_backend#
- scikitplot.corpus.select_backend(name='auto', *, index_kwargs=None, annoy_metric='angular', annoy_n_trees=10, annoy_search_k=-1, annoy_impl='auto', annoy_dtype=None, annoy_index_dtype=None, **kwargs)[source]#
Construct an ANN backend by name.
- Parameters:
- namestr or VectorIndexBackend subclass, optional
"auto"(default) resolves the first available backend inDEFAULT_BACKEND_ORDER. An explicit built-in name is honoured or raises if unavailable. A customVectorIndexBackendsubclass may be supplied directly.- index_kwargsmapping, optional
Generic constructor keyword arguments for the selected backend. New code should prefer this mapping instead of adding backend-specific parameters to
RetrievalConfig.- annoy_metric, annoy_n_trees, annoy_search_k, annoy_impl, annoy_dtype, annoy_index_dtype
Backward-compatible Annoy constructor settings. They are merged only when the resolved backend is
AnnoyBackend; genericindex_kwargswin over default legacy values.- **kwargsAny
Compatibility form for generic backend constructor keyword arguments. Conflicting keys between
index_kwargsandkwargsraise.
- Returns:
- VectorIndexBackend
An unbuilt backend instance.
- Raises:
- ValueError
If name is not a known backend or
"auto".- RuntimeError
If an explicitly named backend is unavailable, or if
"auto"finds no available backend (numpy missing).
- Parameters:
- Return type: