Skip to content

daft.functions.pearson_correlation#

pearson_correlation #

pearson_correlation(left: Expression, right: Expression) -> Expression

Compute the Pearson correlation between two embeddings.

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 Pearson correlation between the two vectors.

Source code in daft/functions/similarity.py
38
39
40
41
42
43
44
45
46
47
48
def pearson_correlation(left: Expression, right: Expression) -> Expression:
    """Compute the Pearson correlation between two embeddings.

    Args:
        left (FixedSizeList or Embedding Expression): The left vector
        right (FixedSizeList or Embedding Expression): The right vector

    Returns:
        Expression (Float64 Expression): the Pearson correlation between the two vectors.
    """
    return Expression._call_builtin_scalar_fn("pearson_correlation", left, right)