Pearson Similarity (Beta)
The Pearson correlation coefficient is a measure of linear correlation between two sets of data. It is the ratio between the covariance of two variables and the product of their standard deviations.
The formula for calculating the Pearson correlation coefficient is as follows:
This algorithm is implemented as a user-defined function. You need to follow the steps in Add a User-Defined Function to add the function to GSQL. After adding the function, you can call it in any GSQL query in the same way as a built-in GSQL function.
Specifications
Parameters
Name | Description | Data type |
| An n-dimensional vector denoted by a |
|
| An n-dimensional vector denoted by a |
|
Return value
The Pearson correlation coefficient between the two vectors.
Example
Last updated