This function is only present in the core library version of CyborgDB.
In other versions (microservice, serverless), it is automatically called once enough vector embeddings have been indexed.
Builds the index using the specified training configuration. Required before efficient querying.
Prior to calling this, all queries will be conducted using encrypted exhaustive search.
After, they will be conducted using encrypted ANN search.
Copy
Ask AI
def train(self, batch_size: int = 2048, max_iters: int = 100, tolerance: float = 1e-6, max_memory: int = 0)
# Load indexindex = client.load_index(index_name=index_name, index_key=index_key)# Train the index with custom settingsindex.train(batch_size=128, max_iters=10, tolerance=1e-4)# Train with default settings (auto-selected configuration)index.train()