[Doc] Fix cosinesimil OpenSearch Score and Distance Function formula (#4138) (#4139)

Signed-off-by: Alireza Fatemi <seyedalirezafatemijahromi@gmail.com>
This commit is contained in:
Seyed Alireza Fatemi Jahromi 2023-05-25 19:45:55 +03:00 committed by GitHub
parent 2745dd51bd
commit 8d394f5726
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -299,7 +299,7 @@ A space corresponds to the function used to measure the distance between two poi
<td>\[ d(\mathbf{x}, \mathbf{y}) = 1 - cos { \theta } = 1 - {\mathbf{x} &middot; \mathbf{y} \over \|\mathbf{x}\| &middot; \|\mathbf{y}\|}\]\[ = 1 -
{\sum_{i=1}^n x_i y_i \over \sqrt{\sum_{i=1}^n x_i^2} &middot; \sqrt{\sum_{i=1}^n y_i^2}}\]
where \(\|\mathbf{x}\|\) and \(\|\mathbf{y}\|\) represent the norms of vectors x and y respectively.</td>
<td><b>nmslib</b> and <b>faiss:</b>\[ score = {1 \over 1 + d } \]<br><b>Lucene:</b>\[ score = {1 + d \over 2}\]</td>
<td><b>nmslib</b> and <b>faiss:</b>\[ score = {1 \over 1 + d } \]<br><b>Lucene:</b>\[ score = {2 - d \over 2}\]</td>
</tr>
<tr>
<td>innerproduct (not supported for Lucene)</td>

View File

@ -306,10 +306,10 @@ A space corresponds to the function used to measure the distance between two poi
</tr>
<tr>
<td>cosinesimil</td>
<td>\[ d(\mathbf{x}, \mathbf{y}) = cos \theta = {\mathbf{x} &middot; \mathbf{y} \over \|\mathbf{x}\| &middot; \|\mathbf{y}\|}\]\[ =
<td>\[ d(\mathbf{x}, \mathbf{y}) = 1 - cos { \theta } = 1 - {\mathbf{x} &middot; \mathbf{y} \over \|\mathbf{x}\| &middot; \|\mathbf{y}\|}\]\[ = 1 -
{\sum_{i=1}^n x_i y_i \over \sqrt{\sum_{i=1}^n x_i^2} &middot; \sqrt{\sum_{i=1}^n y_i^2}}\]
where \(\|\mathbf{x}\|\) and \(\|\mathbf{y}\|\) represent normalized vectors.</td>
<td>\[ score = 1 + d \]</td>
where \(\|\mathbf{x}\|\) and \(\|\mathbf{y}\|\) represent the norms of vectors x and y respectively.</td>
<td>\[ score = 2 - d \]</td>
</tr>
<tr>
<td>innerproduct (not supported for Lucene)</td>