Train waits until training finishes before returning.
Parameters
TrainParams
All fields are pointers;nil uses the service default. Pass cyborgdb.TrainParams{} for all defaults.
Parameter values aren’t range-checked: an out-of-range value such as a negative list count is accepted, and training is skipped as described in Requirements.
Requirements
Training only runs when all three hold:- The index has at least 10,000 vectors.
- It has at least twice as many vectors as
NLists. - The vector dimension is a multiple of 32, such as 384, 768, or 1536.
Returns
error only. If the index is already training, Train waits for that run to finish, then trains again.
Errors
*AuthenticationError
*AuthenticationError
The client isn’t using the root key (HTTP
401/403). Training requires the root key.*NotFoundError
*NotFoundError
The index doesn’t exist (HTTP
404). A wrong key gives *NotFoundError or *AuthenticationError, as described in Load Index.*ServiceError / *TransportError
*ServiceError / *TransportError
The service returns
5xx or can’t be reached. A failed training run doesn’t return an error; see Requirements.