Rate This Document
Findability
Accuracy
Completeness
Readability

tree

API Definition

def tree(num_leaves: int, num_leaves_to_search: int, training_sample_size: int, min_partition_size: int, training_iterations: int, spherical: bool, quantize_centroids: bool, random_init: bool) -> scann.scann_ops.py.scann_builder.ScannBuilder

Function

Add parameters related to the inverted file (IVF) index partition. It is consistent with the open source algorithm API.

Parameters

Parameter

Description

Data Type

Value Range

num_leaves

Total subspace number in the IVF partition.

int

≥ 1

num_leaves_to_search

Default number of subspaces to be searched.

int

[1, num_leaves], where num_leaves indicates the total number of subspaces in the IVF index partition.

training_sample_size

Number of samples in the base library during partitioned training.

int

[0, number_of_base_libraries]

min_partition_size

Number of base library vectors contained in the smallest partition.

int

[0, number_of_base_libraries]

training_iterations

Number of training iterations.

int

≥ 1

spherical

Indicates whether the partition type is spherical.

Boolean

-

quantize_centroids

Indicates whether to quantize the bucket center.

Boolean

-

random_init

Indicates whether to start training randomly.

Boolean

-

Return Value

Data Type

Description

scann.scann_ops.py.scann_builder.ScannBuilder

ScannBuilder is used to receive build parameters.