From f23b3131fe7bafeaf9f171d05bb45622a7870ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20Coss=C3=ADo?= Date: Thu, 12 Jun 2025 10:45:50 -0400 Subject: [PATCH] update best_score formula (#1699) --- qdrant-landing/content/documentation/concepts/explore.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qdrant-landing/content/documentation/concepts/explore.md b/qdrant-landing/content/documentation/concepts/explore.md index c8d038e86..27b9e1f18 100644 --- a/qdrant-landing/content/documentation/concepts/explore.md +++ b/qdrant-landing/content/documentation/concepts/explore.md @@ -55,10 +55,13 @@ A new strategy introduced in v1.6, is called `best_score`. It is based on the id The way it works is that each candidate is measured against every example, then we select the best positive and best negative scores. The final score is chosen with this step formula: ```rust +// Sigmoid function to normalize the score between 0 and 1 +let sigmoid = |x| 0.5 * (1.0 + (x / (1.0 + x.abs()))); + let score = if best_positive_score > best_negative_score { - best_positive_score + sigmoid(best_positive_score) } else { - -(best_negative_score * best_negative_score) + -sigmoid(best_negative_score) }; ```