link_grouped_embeddings
Create network links calculating the similarity of embeddings (vectors) within groups.
link_grouped_embeddings(embedding: list[number], grouping: category, {
"param": value,
...
}) -> (targets: column, weights: column)
Creates network links only if the row’s embeddings belong to the same group.
E.g., text embeddings calculated for different languages are not necessarily compatible (even if they have the same dimension). Use this step if embeddings in different groups cannot be compared directly.
link_grouped_embeddings(embedding: list[number], grouping: category, {
"param": value,
...
}) -> (targets: column, weights: column)
Number of nearest embeddings to take into account.
Values must be in the following range:
1 ≤ n_nearest < inf
Minimum similarity for connecting two nodes (similarity ∈ [0, 1]).
Values must be in the following range:
0 ≤ similarity_min ≤ 1
Minimum similarity for connecting two nodes, expressed as a quantile of the similarity distribution (similarity ∈ [0, 1]).
Values must be in the following range:
0 ≤ similarity_min_q ≤ 1
Number of trees. Affects the build time and the index size. A larger value will give more accurate results, but will take longer to create a larger index.
Accuracy multipler. A larger value will give more accurate results, but will take longer time to return.
Metric to use, only angular supported for now. Annoy’s angular metric is equivalent to sqrt(2*(1-cos(u,v))), whose max. is sqrt(2*2) = 2. I.e. the distance between (1,0) and (-1,0), at maximum angular separation, should be exactly 2 Note that for the weights of the resulting network links Annoy’s distances are converted to similarities in the interval [0,1].
Values must be one of the following:
angular
euclidean
manhattan
hamming
dot
Used to seed the random number generator, creating deterministic results.
Was this page helpful?
link_grouped_embeddings(embedding: list[number], grouping: category, {
"param": value,
...
}) -> (targets: column, weights: column)