From bd73a574ade91b56ab1ad77c588f6f6f090e1268 Mon Sep 17 00:00:00 2001 From: reza bagheri alashti Date: Wed, 6 May 2026 18:42:53 +0330 Subject: [PATCH] Docs: fix CosineSimilarity formula and clarify similarity metric names in BitOps.h (#9264) * Fix CosineSimilarity doc formula and clarify similarity metric names in BitOps.h * Fix CosineSimilarity formula in BitOps.h and adjust similarity docs --- Code/DataStructs/BitOps.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Code/DataStructs/BitOps.h b/Code/DataStructs/BitOps.h index 96a21c044..e18431058 100644 --- a/Code/DataStructs/BitOps.h +++ b/Code/DataStructs/BitOps.h @@ -105,7 +105,8 @@ RDKIT_DATASTRUCTS_EXPORT double TanimotoSimilarity(const T1 &bv1, //! returns the Cosine similarity between two bit vects /*! - \return (bv1&bv2)_o / sqrt(bv1_o + bv2_o) + Also known as the Ochiai coefficient. + \return (bv1&bv2)_o / sqrt(bv1_o * bv2_o) */ template RDKIT_DATASTRUCTS_EXPORT double CosineSimilarity(const T1 &bv1, const T2 &bv2); @@ -157,6 +158,7 @@ RDKIT_DATASTRUCTS_EXPORT double McConnaugheySimilarity(const T1 &bv1, //! returns the Asymmetric similarity between two bit vects /*! + Also known as the **Simpson similarity** or **Overlap coefficient**. \return (bv1&bv2)_o / min(bv1_o,bv2_o) */ template @@ -209,8 +211,12 @@ RDKIT_DATASTRUCTS_EXPORT int NumBitsInCommon(const ExplicitBitVect &bv1, const ExplicitBitVect &bv2); //! returns the common-bit similarity (on and off) between two bit vects -//! This is also called Manhattan similarity. /*! + Also known as: + - **Simple Matching Coefficient** + - **Rand similarity** + - **Sokal–Michener similarity** + \return [bv1_n - (bv1^bv2)_o] / bv1_n */ template