pub struct IndexParams(pub cuvsIvfFlatIndexParams_t);Tuple Fields§
§0: cuvsIvfFlatIndexParams_tImplementations§
Source§impl IndexParams
impl IndexParams
Sourcepub fn new() -> Result<IndexParams>
pub fn new() -> Result<IndexParams>
Returns a new IndexParams
Sourcepub fn set_n_lists(self, n_lists: u32) -> IndexParams
pub fn set_n_lists(self, n_lists: u32) -> IndexParams
The number of clusters used in the coarse quantizer.
Sourcepub fn set_metric(self, metric: DistanceType) -> IndexParams
pub fn set_metric(self, metric: DistanceType) -> IndexParams
DistanceType to use for building the index
Sourcepub fn set_metric_arg(self, metric_arg: f32) -> IndexParams
pub fn set_metric_arg(self, metric_arg: f32) -> IndexParams
The number of iterations searching for kmeans centers during index building.
Sourcepub fn set_kmeans_n_iters(self, kmeans_n_iters: u32) -> IndexParams
pub fn set_kmeans_n_iters(self, kmeans_n_iters: u32) -> IndexParams
The number of iterations searching for kmeans centers during index building.
Sourcepub fn set_kmeans_trainset_fraction(
self,
kmeans_trainset_fraction: f64,
) -> IndexParams
pub fn set_kmeans_trainset_fraction( self, kmeans_trainset_fraction: f64, ) -> IndexParams
If kmeans_trainset_fraction is less than 1, then the dataset is subsampled, and only n_samples * kmeans_trainset_fraction rows are used for training.
Sourcepub fn set_add_data_on_build(self, add_data_on_build: bool) -> IndexParams
pub fn set_add_data_on_build(self, add_data_on_build: bool) -> IndexParams
After training the coarse and fine quantizers, we will populate the index with the dataset if add_data_on_build == true, otherwise the index is left empty, and the extend method can be used to add new vectors to the index.
Trait Implementations§
Source§impl Debug for IndexParams
impl Debug for IndexParams
Auto Trait Implementations§
impl Freeze for IndexParams
impl RefUnwindSafe for IndexParams
impl !Send for IndexParams
impl !Sync for IndexParams
impl Unpin for IndexParams
impl UnwindSafe for IndexParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more