daft.functions.jaccard_similarity#
jaccard_similarity #
jaccard_similarity(left: Expression, right: Expression) -> Expression
Compute the Jaccard similarity between two embeddings.
The Jaccard similarity is computed by treating non-zero elements as set membership and comparing intersection over union.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
left | FixedSizeList or Embedding Expression | The left vector | required |
right | FixedSizeList or Embedding Expression | The right vector | required |
Returns:
| Name | Type | Description |
|---|---|---|
Expression | Float64 Expression | the Jaccard similarity between the two vectors. |
Source code in daft/functions/similarity.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 | |