From 06f8d0e5b9d2d699ab622e7d3c83e3ac0b28c817 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Thu, 29 Dec 2022 09:30:57 +0330
Subject: [PATCH 01/47] feat : distance method added #349 #350

---
 pycm/pycm_distance.py | 129 ++++++++++++++++++++++++++++++++++++++++++
 pycm/pycm_obj.py      |  16 ++++++
 pycm/pycm_param.py    |   2 +
 3 files changed, 147 insertions(+)
 create mode 100644 pycm/pycm_distance.py

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
new file mode 100644
index 00000000..14433515
--- /dev/null
+++ b/pycm/pycm_distance.py
@@ -0,0 +1,129 @@
+# -*- coding: utf-8 -*-
+"""Distance/Similarity functions."""
+from __future__ import division
+from enum import Enum
+import math
+
+class DistanceType(Enum):
+    """
+    Distance metric type class.
+    >>> pycm.DistanceType.AMPLE
+    """
+
+    AMPLE = "AMPLE"
+    Anderberg = "Anderberg"
+    AndresMarzoDelta = "AndresMarzoDelta"
+    BaroniUrbaniBuserI = "BaroniUrbaniBuserI"
+    BaroniUrbaniBuserII = "BaroniUrbaniBuserII"
+
+def AMPLE_calc(TP, FP, FN, TN):
+    """
+    Calculate AMPLE.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: AMPLE as float
+    """
+    try:
+        part1 = TP/(TP + FP)
+        part2 = FN/(FN + TN)
+        return abs(part1 - part2)
+    except Exception:
+        return "None"
+
+def Anderberg_calc(TP, FP, FN, TN):
+    """
+    Calculate Anderberg's D.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Anderberg's D as float
+    """
+    try:
+        part1 = max(TP, FP) + max(FN, TN) + max(TP, FN) + max(FP, TN)
+        part2 = max(TP + FP, FP + TN) + max(TP + FP, FN + TN)
+        n = TP + FP + FN + TN
+        return (part1 - part2) / (2 * n)
+    except Exception:
+        return "None"
+
+
+def AndresMarzoDelta_calc(TP, FP, FN, TN):
+    """
+    Calculate Andres & Marzo's Delta.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Andres & Marzo's Delta as float
+    """
+    try:
+        part1 = TP + TN - 2 * math.sqrt(FP * FN)
+        n = TP + FP + FN + TN
+        return part1 / n
+    except Exception:
+        return "None"
+
+def BaroniUrbaniBuserI_calc(TP, FP, FN, TN):
+    """
+    Calculate Baroni-Urbani & Buser I.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baroni-Urbani & Buser I as float
+    """
+    try:
+        part1 = math.sqrt(TP * TN) + TP
+        part2 = part1 + FP + FN
+        return part1 / part2
+    except Exception:
+        return "None"
+
+def BaroniUrbaniBuserII_calc(TP, FP, FN, TN):
+    """
+    Calculate Baroni-Urbani & Buser II.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baroni-Urbani & Buser II as float
+    """
+    try:
+        part1 = math.sqrt(TP * TN) + TP - FP - FN
+        part2 = math.sqrt(TP * TN) + TP + FP + FN
+        return part1 / part2
+    except Exception:
+        return "None"
+
+
+
+DISTANCE_MAPPER = {DistanceType.AMPLE: AMPLE_calc, DistanceType.Anderberg: Anderberg_calc, DistanceType.AndresMarzoDelta: AndresMarzoDelta_calc, DistanceType.BaroniUrbaniBuserI:
+    BaroniUrbaniBuserI_calc, DistanceType.BaroniUrbaniBuserII: BaroniUrbaniBuserII_calc}
\ No newline at end of file
diff --git a/pycm/pycm_obj.py b/pycm/pycm_obj.py
index e2072e2f..6cd1f62c 100644
--- a/pycm/pycm_obj.py
+++ b/pycm/pycm_obj.py
@@ -6,6 +6,7 @@
 from .pycm_handler import __obj_assign_handler__, __obj_file_handler__, __obj_matrix_handler__, __obj_vector_handler__, __obj_array_handler__
 from .pycm_class_func import F_calc, IBA_calc, TI_calc, NB_calc, sensitivity_index_calc
 from .pycm_overall_func import weighted_kappa_calc, weighted_alpha_calc, alpha2_calc, brier_score_calc
+from .pycm_distance import DistanceType, DISTANCE_MAPPER
 from .pycm_output import *
 from .pycm_util import *
 from .pycm_param import *
@@ -591,6 +592,21 @@ def NB(self, w=1):
         except Exception:
             return {}
 
+    def distance(self, metric):
+        """
+        Calculate distance/similarity for all classes.
+
+        :param metric: metric
+        :type metric: DistanceType
+        :return: result as float
+        """
+        distance_dict = {}
+        if not isinstance(metric, DistanceType):
+            pycmMatrixError(DISTANCE_METRIC_TYPE_ERROR)
+        for i in self.classes:
+            distance_dict[i] = DISTANCE_MAPPER[metric](TP = self.TP[i], FP = self.FP[i], FN = self.FN[i], TN = self.TN[i])
+        return distance_dict
+
     def CI(
             self,
             param,
diff --git a/pycm/pycm_param.py b/pycm/pycm_param.py
index f22c99a2..d94bae7f 100644
--- a/pycm/pycm_param.py
+++ b/pycm/pycm_param.py
@@ -117,6 +117,8 @@
 
 CURVE_NONE_WARNING = "The curve axes contain non-numerical value(s)."
 
+DISTANCE_METRIC_TYPE_ERROR = "The metric type must be DistanceType"
+
 CLASS_NUMBER_THRESHOLD = 10
 
 BALANCE_RATIO_THRESHOLD = 3

From dcb404b6633a1a72dd6573eeb76817eda8aa2c85 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Thu, 29 Dec 2022 09:34:32 +0330
Subject: [PATCH 02/47] doc : minor edit in docstring

---
 pycm/pycm_distance.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 14433515..c1e8353a 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -7,6 +7,7 @@
 class DistanceType(Enum):
     """
     Distance metric type class.
+    
     >>> pycm.DistanceType.AMPLE
     """
 

From 6f3c8d07d51a1fe9a8d4014fa754cbb19cb61842 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Thu, 29 Dec 2022 09:39:23 +0330
Subject: [PATCH 03/47] fix : minor edit in distance method error handler

---
 pycm/pycm_obj.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pycm/pycm_obj.py b/pycm/pycm_obj.py
index 6cd1f62c..7f7d5ea7 100644
--- a/pycm/pycm_obj.py
+++ b/pycm/pycm_obj.py
@@ -602,7 +602,7 @@ def distance(self, metric):
         """
         distance_dict = {}
         if not isinstance(metric, DistanceType):
-            pycmMatrixError(DISTANCE_METRIC_TYPE_ERROR)
+            raise pycmMatrixError(DISTANCE_METRIC_TYPE_ERROR)
         for i in self.classes:
             distance_dict[i] = DISTANCE_MAPPER[metric](TP = self.TP[i], FP = self.FP[i], FN = self.FN[i], TN = self.TN[i])
         return distance_dict

From 2c938bb6a3ab74212a2b4b0a9f221f7507441406 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 11:04:26 +0330
Subject: [PATCH 04/47] edit : minor pep8 edits.

---
 pycm/pycm_distance.py | 21 +++++++++++++++------
 pycm/pycm_obj.py      |  3 ++-
 2 files changed, 17 insertions(+), 7 deletions(-)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index c1e8353a..11352ac9 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -4,10 +4,11 @@
 from enum import Enum
 import math
 
+
 class DistanceType(Enum):
     """
     Distance metric type class.
-    
+
     >>> pycm.DistanceType.AMPLE
     """
 
@@ -17,6 +18,7 @@ class DistanceType(Enum):
     BaroniUrbaniBuserI = "BaroniUrbaniBuserI"
     BaroniUrbaniBuserII = "BaroniUrbaniBuserII"
 
+
 def AMPLE_calc(TP, FP, FN, TN):
     """
     Calculate AMPLE.
@@ -32,12 +34,13 @@ def AMPLE_calc(TP, FP, FN, TN):
     :return: AMPLE as float
     """
     try:
-        part1 = TP/(TP + FP)
-        part2 = FN/(FN + TN)
+        part1 = TP / (TP + FP)
+        part2 = FN / (FN + TN)
         return abs(part1 - part2)
     except Exception:
         return "None"
 
+
 def Anderberg_calc(TP, FP, FN, TN):
     """
     Calculate Anderberg's D.
@@ -82,6 +85,7 @@ def AndresMarzoDelta_calc(TP, FP, FN, TN):
     except Exception:
         return "None"
 
+
 def BaroniUrbaniBuserI_calc(TP, FP, FN, TN):
     """
     Calculate Baroni-Urbani & Buser I.
@@ -103,6 +107,7 @@ def BaroniUrbaniBuserI_calc(TP, FP, FN, TN):
     except Exception:
         return "None"
 
+
 def BaroniUrbaniBuserII_calc(TP, FP, FN, TN):
     """
     Calculate Baroni-Urbani & Buser II.
@@ -125,6 +130,10 @@ def BaroniUrbaniBuserII_calc(TP, FP, FN, TN):
         return "None"
 
 
-
-DISTANCE_MAPPER = {DistanceType.AMPLE: AMPLE_calc, DistanceType.Anderberg: Anderberg_calc, DistanceType.AndresMarzoDelta: AndresMarzoDelta_calc, DistanceType.BaroniUrbaniBuserI:
-    BaroniUrbaniBuserI_calc, DistanceType.BaroniUrbaniBuserII: BaroniUrbaniBuserII_calc}
\ No newline at end of file
+DISTANCE_MAPPER = {
+    DistanceType.AMPLE: AMPLE_calc,
+    DistanceType.Anderberg: Anderberg_calc,
+    DistanceType.AndresMarzoDelta: AndresMarzoDelta_calc,
+    DistanceType.BaroniUrbaniBuserI: BaroniUrbaniBuserI_calc,
+    DistanceType.BaroniUrbaniBuserII: BaroniUrbaniBuserII_calc,
+    }
diff --git a/pycm/pycm_obj.py b/pycm/pycm_obj.py
index 7f7d5ea7..07d2b5a0 100644
--- a/pycm/pycm_obj.py
+++ b/pycm/pycm_obj.py
@@ -604,7 +604,8 @@ def distance(self, metric):
         if not isinstance(metric, DistanceType):
             raise pycmMatrixError(DISTANCE_METRIC_TYPE_ERROR)
         for i in self.classes:
-            distance_dict[i] = DISTANCE_MAPPER[metric](TP = self.TP[i], FP = self.FP[i], FN = self.FN[i], TN = self.TN[i])
+            distance_dict[i] = DISTANCE_MAPPER[metric](
+                TP=self.TP[i], FP=self.FP[i], FN=self.FN[i], TN=self.TN[i])
         return distance_dict
 
     def CI(

From d8bf9530b2eadb2528cdc755716c2b3c3aec9bbf Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 11:10:13 +0330
Subject: [PATCH 05/47] add : `BatageljBren` metric added.

---
 pycm/pycm_distance.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 11352ac9..add4f155 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -17,6 +17,7 @@ class DistanceType(Enum):
     AndresMarzoDelta = "AndresMarzoDelta"
     BaroniUrbaniBuserI = "BaroniUrbaniBuserI"
     BaroniUrbaniBuserII = "BaroniUrbaniBuserII"
+    BatageljBren = "BatageljBren"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -130,10 +131,31 @@ def BaroniUrbaniBuserII_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BatageljBren_calc(TP, FP, FN, TN):
+    """
+    Calculate Batagelj & Bren.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Batagelj & Bren as float
+    """
+    try:
+        return (FP * FN) / (TP * TN)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
     DistanceType.AndresMarzoDelta: AndresMarzoDelta_calc,
     DistanceType.BaroniUrbaniBuserI: BaroniUrbaniBuserI_calc,
     DistanceType.BaroniUrbaniBuserII: BaroniUrbaniBuserII_calc,
+    DistanceType.BatageljBren: BatageljBren_calc,
     }

From e2d82dbd5d435cda37280681a816855e0f84dea9 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 11:18:16 +0330
Subject: [PATCH 06/47] add : `BaulieuI` metric added.

---
 pycm/pycm_distance.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index add4f155..df00b8fc 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -18,6 +18,7 @@ class DistanceType(Enum):
     BaroniUrbaniBuserI = "BaroniUrbaniBuserI"
     BaroniUrbaniBuserII = "BaroniUrbaniBuserII"
     BatageljBren = "BatageljBren"
+    BaulieuI = "BaulieuI"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -151,6 +152,27 @@ def BatageljBren_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuI_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu I.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu I as float
+    """
+    try:
+        part1 = (TP + FP) * (TP + FN)
+        return (part1 - TP * TP) / part1
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -158,4 +180,5 @@ def BatageljBren_calc(TP, FP, FN, TN):
     DistanceType.BaroniUrbaniBuserI: BaroniUrbaniBuserI_calc,
     DistanceType.BaroniUrbaniBuserII: BaroniUrbaniBuserII_calc,
     DistanceType.BatageljBren: BatageljBren_calc,
+    DistanceType.BaulieuI: BaulieuI_calc,
     }

From 43ab69342e06410c02b9e1e2e9248744bd158e2e Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 11:26:04 +0330
Subject: [PATCH 07/47] add : `BaulieuII` metric added.

---
 pycm/pycm_distance.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index df00b8fc..b539de7b 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -19,6 +19,7 @@ class DistanceType(Enum):
     BaroniUrbaniBuserII = "BaroniUrbaniBuserII"
     BatageljBren = "BatageljBren"
     BaulieuI = "BaulieuI"
+    BaulieuII = "BaulieuII"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -173,6 +174,28 @@ def BaulieuI_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuII_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu II.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu II as float
+    """
+    try:
+        part1 = TP * TP * TN * TN
+        part2 = (TP + FP) * (TP + FN) * (FP + TN) * (FN + TN)
+        return part1 / part2
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -181,4 +204,5 @@ def BaulieuI_calc(TP, FP, FN, TN):
     DistanceType.BaroniUrbaniBuserII: BaroniUrbaniBuserII_calc,
     DistanceType.BatageljBren: BatageljBren_calc,
     DistanceType.BaulieuI: BaulieuI_calc,
+    DistanceType.BaulieuII: BaroniUrbaniBuserII_calc,
     }

From b409df9c79da5d822407d68f6d54133892365d27 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 11:41:13 +0330
Subject: [PATCH 08/47] add : `BaulieuIII` metric added.

---
 pycm/pycm_distance.py | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index b539de7b..8a118275 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -20,6 +20,7 @@ class DistanceType(Enum):
     BatageljBren = "BatageljBren"
     BaulieuI = "BaulieuI"
     BaulieuII = "BaulieuII"
+    BaulieuIII = "BaulieuIII"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -196,6 +197,28 @@ def BaulieuII_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuIII_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu III.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu III as float
+    """
+    try:
+        n = TP + FP + FN + TN
+        part1 = n * n - 4 * (TP * TN - FP * FN)
+        return part1 / (2 * n * n)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -204,5 +227,6 @@ def BaulieuII_calc(TP, FP, FN, TN):
     DistanceType.BaroniUrbaniBuserII: BaroniUrbaniBuserII_calc,
     DistanceType.BatageljBren: BatageljBren_calc,
     DistanceType.BaulieuI: BaulieuI_calc,
-    DistanceType.BaulieuII: BaroniUrbaniBuserII_calc,
+    DistanceType.BaulieuII: BaulieuII_calc,
+    DistanceType.BaulieuIII: BaulieuIII_calc,
     }

From 2e98c7e0556b14520087358fc37937638a55e7d6 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 11:47:29 +0330
Subject: [PATCH 09/47] add : `BaulieuIV` metric added.

---
 pycm/pycm_distance.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 8a118275..4eadcdde 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -21,6 +21,7 @@ class DistanceType(Enum):
     BaulieuI = "BaulieuI"
     BaulieuII = "BaulieuII"
     BaulieuIII = "BaulieuIII"
+    BaulieuIV = "BaulieuIV"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -219,6 +220,28 @@ def BaulieuIII_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuIV_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu IV.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu IV as float
+    """
+    try:
+        n = TP + FP + FN + TN
+        part1 = FP + FN - (TP + 0.5) * (TN + 0.5) * TN * math.e
+        return part1 / n
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -229,4 +252,5 @@ def BaulieuIII_calc(TP, FP, FN, TN):
     DistanceType.BaulieuI: BaulieuI_calc,
     DistanceType.BaulieuII: BaulieuII_calc,
     DistanceType.BaulieuIII: BaulieuIII_calc,
+    DistanceType.BaulieuIV: BaulieuIV_calc,
     }

From a5a04aa2a30929ce9c815765bc34c49559af378a Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 13:15:01 +0330
Subject: [PATCH 10/47] add : `BaulieuV` metric added.

---
 pycm/pycm_distance.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 4eadcdde..eb73251e 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -22,6 +22,7 @@ class DistanceType(Enum):
     BaulieuII = "BaulieuII"
     BaulieuIII = "BaulieuIII"
     BaulieuIV = "BaulieuIV"
+    BaulieuV = "BaulieuV"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -242,6 +243,26 @@ def BaulieuIV_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuV_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu V.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu V as float
+    """
+    try:
+        return (FP + FN + 1) / (TP + FP + FN + 1)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -253,4 +274,5 @@ def BaulieuIV_calc(TP, FP, FN, TN):
     DistanceType.BaulieuII: BaulieuII_calc,
     DistanceType.BaulieuIII: BaulieuIII_calc,
     DistanceType.BaulieuIV: BaulieuIV_calc,
+    DistanceType.BaulieuV: BaulieuV_calc,
     }

From f5dc682ebd4a9a626ed38fee7b6521ff4b58ee63 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 13:17:07 +0330
Subject: [PATCH 11/47] add : `BaulieuVI` metric added.

---
 pycm/pycm_distance.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index eb73251e..711e1e9a 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -23,6 +23,7 @@ class DistanceType(Enum):
     BaulieuIII = "BaulieuIII"
     BaulieuIV = "BaulieuIV"
     BaulieuV = "BaulieuV"
+    BaulieuVI = "BaulieuVI"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -263,6 +264,26 @@ def BaulieuV_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuVI_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu VI.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu VI as float
+    """
+    try:
+        return (FP + FN) / (TP + FP + FN + 1)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -275,4 +296,5 @@ def BaulieuV_calc(TP, FP, FN, TN):
     DistanceType.BaulieuIII: BaulieuIII_calc,
     DistanceType.BaulieuIV: BaulieuIV_calc,
     DistanceType.BaulieuV: BaulieuV_calc,
+    DistanceType.BaulieuVI: BaulieuVI_calc,
     }

From fc4d40f76b93e7221a91fa32c6220cff9ff030f7 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 13:20:43 +0330
Subject: [PATCH 12/47] add : `BaulieuVII` metric added.

---
 pycm/pycm_distance.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 711e1e9a..bca1c695 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -24,6 +24,7 @@ class DistanceType(Enum):
     BaulieuIV = "BaulieuIV"
     BaulieuV = "BaulieuV"
     BaulieuVI = "BaulieuVI"
+    BaulieuVII = "BaulieuVII"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -284,6 +285,27 @@ def BaulieuVI_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuVII_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu VII.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu VII as float
+    """
+    try:
+        n = TP + FP + FN + TN
+        return (FP + FN) / (n + TP * (TP - 4) * (TP - 4))
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -297,4 +319,5 @@ def BaulieuVI_calc(TP, FP, FN, TN):
     DistanceType.BaulieuIV: BaulieuIV_calc,
     DistanceType.BaulieuV: BaulieuV_calc,
     DistanceType.BaulieuVI: BaulieuVI_calc,
+    DistanceType.BaulieuVII: BaulieuVII_calc,
     }

From 604b946db4ac632262a7cc6de662b0802b22e9b8 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 13:23:43 +0330
Subject: [PATCH 13/47] add : `BaulieuVIII` metric added.

---
 pycm/pycm_distance.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index bca1c695..91d7c547 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -25,6 +25,7 @@ class DistanceType(Enum):
     BaulieuV = "BaulieuV"
     BaulieuVI = "BaulieuVI"
     BaulieuVII = "BaulieuVII"
+    BaulieuVIII = "BaulieuVIII"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -306,6 +307,27 @@ def BaulieuVII_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuVIII_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu VIII.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu VIII as float
+    """
+    try:
+        n = TP + FP + FN + TN
+        return ((FP - FN) * (FP - FN)) / (n * n) 
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -320,4 +342,5 @@ def BaulieuVII_calc(TP, FP, FN, TN):
     DistanceType.BaulieuV: BaulieuV_calc,
     DistanceType.BaulieuVI: BaulieuVI_calc,
     DistanceType.BaulieuVII: BaulieuVII_calc,
+    DistanceType.BaulieuVIII: BaulieuVIII_calc,
     }

From 529eb0485abd70aa0a57c7b7f3eac80076006593 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 13:26:53 +0330
Subject: [PATCH 14/47] add : `BaulieuIX` metric added.

---
 pycm/pycm_distance.py | 24 +++++++++++++++++++++++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 91d7c547..a46fc265 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -26,6 +26,7 @@ class DistanceType(Enum):
     BaulieuVI = "BaulieuVI"
     BaulieuVII = "BaulieuVII"
     BaulieuVIII = "BaulieuVIII"
+    BaulieuIX = "BaulieuIX"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -323,7 +324,27 @@ def BaulieuVIII_calc(TP, FP, FN, TN):
     """
     try:
         n = TP + FP + FN + TN
-        return ((FP - FN) * (FP - FN)) / (n * n) 
+        return ((FP - FN) * (FP - FN)) / (n * n)
+    except Exception:
+        return "None"
+
+
+def BaulieuIX_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu IX.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu IX as float
+    """
+    try:
+        return (FP + 2 * FN) / (TP + FP + 2 * FN + TN)
     except Exception:
         return "None"
 
@@ -343,4 +364,5 @@ def BaulieuVIII_calc(TP, FP, FN, TN):
     DistanceType.BaulieuVI: BaulieuVI_calc,
     DistanceType.BaulieuVII: BaulieuVII_calc,
     DistanceType.BaulieuVIII: BaulieuVIII_calc,
+    DistanceType.BaulieuIX: BaulieuIX_calc,
     }

From 7ca4ba1f14e7379d03d2c5c9ccb70c18317a6d8c Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 13:31:32 +0330
Subject: [PATCH 15/47] add : `BaulieuX` metric.

---
 pycm/pycm_distance.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index a46fc265..419e7838 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -27,6 +27,7 @@ class DistanceType(Enum):
     BaulieuVII = "BaulieuVII"
     BaulieuVIII = "BaulieuVIII"
     BaulieuIX = "BaulieuIX"
+    BaulieuX = "BaulieuX"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -349,6 +350,28 @@ def BaulieuIX_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuX_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu X.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu X as float
+    """
+    try:
+        n = TP + FP + FN + TN
+        max_bc = max(FP, FN)
+        return (FP + FN + max_bc) / (n + max_bc)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -365,4 +388,5 @@ def BaulieuIX_calc(TP, FP, FN, TN):
     DistanceType.BaulieuVII: BaulieuVII_calc,
     DistanceType.BaulieuVIII: BaulieuVIII_calc,
     DistanceType.BaulieuIX: BaulieuIX_calc,
+    DistanceType.BaulieuX: BaulieuX_calc,
     }

From 8d9db0b69d469ddef0f6b00913702f5828f49687 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 13:36:08 +0330
Subject: [PATCH 16/47] add : `BaulieuXI` metric.

---
 pycm/pycm_distance.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 419e7838..a0b5a1ab 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -28,6 +28,7 @@ class DistanceType(Enum):
     BaulieuVIII = "BaulieuVIII"
     BaulieuIX = "BaulieuIX"
     BaulieuX = "BaulieuX"
+    BaulieuXI = "BaulieuXI"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -372,6 +373,26 @@ def BaulieuX_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuXI_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu XI.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu XI as float
+    """
+    try:
+        return (FP + FN) / (FP + FN + TN)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -389,4 +410,5 @@ def BaulieuX_calc(TP, FP, FN, TN):
     DistanceType.BaulieuVIII: BaulieuVIII_calc,
     DistanceType.BaulieuIX: BaulieuIX_calc,
     DistanceType.BaulieuX: BaulieuX_calc,
+    DistanceType.BaulieuXI: BaulieuXI_calc,
     }

From 0f4bf3af27fda6e54e8a04d6c37a4a676b807223 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 13:38:12 +0330
Subject: [PATCH 17/47] add : `BaulieuXII` metric.

---
 pycm/pycm_distance.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index a0b5a1ab..f850ac0b 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -29,6 +29,7 @@ class DistanceType(Enum):
     BaulieuIX = "BaulieuIX"
     BaulieuX = "BaulieuX"
     BaulieuXI = "BaulieuXI"
+    BaulieuXII = "BaulieuXII"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -393,6 +394,26 @@ def BaulieuXI_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuXII_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu XII.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu XII as float
+    """
+    try:
+        return (FP + FN) / (TP + FP + FN - 1)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -411,4 +432,5 @@ def BaulieuXI_calc(TP, FP, FN, TN):
     DistanceType.BaulieuIX: BaulieuIX_calc,
     DistanceType.BaulieuX: BaulieuX_calc,
     DistanceType.BaulieuXI: BaulieuXI_calc,
+    DistanceType.BaulieuXII: BaulieuXII_calc,
     }

From f932025e9721ddb6793b9241a5c130d7df3ef18f Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 13:41:33 +0330
Subject: [PATCH 18/47] add : `BaulieuXIII` metric.

---
 pycm/pycm_distance.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index f850ac0b..6c83ebca 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -30,6 +30,7 @@ class DistanceType(Enum):
     BaulieuX = "BaulieuX"
     BaulieuXI = "BaulieuXI"
     BaulieuXII = "BaulieuXII"
+    BaulieuXIII = "BaulieuXIII"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -414,6 +415,27 @@ def BaulieuXII_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuXIII_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu XIII.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu XIII as float
+    """
+    try:
+        part2 = TP + FP + FN + TP * (TP - 4) * (TP - 4)
+        return (FP + FN) / part2
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -433,4 +455,5 @@ def BaulieuXII_calc(TP, FP, FN, TN):
     DistanceType.BaulieuX: BaulieuX_calc,
     DistanceType.BaulieuXI: BaulieuXI_calc,
     DistanceType.BaulieuXII: BaulieuXII_calc,
+    DistanceType.BaulieuXIII: BaulieuXIII_calc,
     }

From e06705623dec4adf4546779a167bbef122d9190c Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 13:43:58 +0330
Subject: [PATCH 19/47] add : `BaulieuXIV` metric.

---
 pycm/pycm_distance.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 6c83ebca..cfb51d73 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -31,6 +31,7 @@ class DistanceType(Enum):
     BaulieuXI = "BaulieuXI"
     BaulieuXII = "BaulieuXII"
     BaulieuXIII = "BaulieuXIII"
+    BaulieuXIV = "BaulieuXIV"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -436,6 +437,26 @@ def BaulieuXIII_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuXIV_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu XIV.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu XIV as float
+    """
+    try:
+        return (FP + 2 * FN) / (TP + FP + 2 * FN)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -456,4 +477,5 @@ def BaulieuXIII_calc(TP, FP, FN, TN):
     DistanceType.BaulieuXI: BaulieuXI_calc,
     DistanceType.BaulieuXII: BaulieuXII_calc,
     DistanceType.BaulieuXIII: BaulieuXIII_calc,
+    DistanceType.BaulieuXIV: BaulieuXIV_calc,
     }

From 8cd1962de34f43b1dab854ed2e06d3d5fb1d3e6a Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 13:46:16 +0330
Subject: [PATCH 20/47] add : `BaulieuXV` metric.

---
 pycm/pycm_distance.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index cfb51d73..8dd86c09 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -32,6 +32,7 @@ class DistanceType(Enum):
     BaulieuXII = "BaulieuXII"
     BaulieuXIII = "BaulieuXIII"
     BaulieuXIV = "BaulieuXIV"
+    BaulieuXV = "BaulieuXV"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -457,6 +458,27 @@ def BaulieuXIV_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BaulieuXV_calc(TP, FP, FN, TN):
+    """
+    Calculate Baulieu XV.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Baulieu XV as float
+    """
+    try:
+        max_bc = max(FP, FN)
+        return (FP + FN + max_bc) / (TP + FP + FN + max_bc)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -478,4 +500,5 @@ def BaulieuXIV_calc(TP, FP, FN, TN):
     DistanceType.BaulieuXII: BaulieuXII_calc,
     DistanceType.BaulieuXIII: BaulieuXIII_calc,
     DistanceType.BaulieuXIV: BaulieuXIV_calc,
+    DistanceType.BaulieuXV: BaulieuXV_calc,
     }

From 6d9c8d0c9e26408934452b6ab5fc5ac83e628fd2 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 14:17:49 +0330
Subject: [PATCH 21/47] add : `BeniniI` metric.

---
 pycm/pycm_distance.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 8dd86c09..7fd376e1 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -33,6 +33,7 @@ class DistanceType(Enum):
     BaulieuXIII = "BaulieuXIII"
     BaulieuXIV = "BaulieuXIV"
     BaulieuXV = "BaulieuXV"
+    BeniniI = "BeniniI"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -479,6 +480,26 @@ def BaulieuXV_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BeniniI_calc(TP, FP, FN, TN):
+    """
+    Calculate Benini I correlation.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Benini I correlation as float
+    """
+    try:
+        return (TP * TN - FP * FN) / ((TP + FN) * (FN + TN))
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -501,4 +522,5 @@ def BaulieuXV_calc(TP, FP, FN, TN):
     DistanceType.BaulieuXIII: BaulieuXIII_calc,
     DistanceType.BaulieuXIV: BaulieuXIV_calc,
     DistanceType.BaulieuXV: BaulieuXV_calc,
+    DistanceType.BeniniI: BeniniI_calc,
     }

From 9a94592fbfb478525c50ef2dae347793d3aaf879 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 14:20:56 +0330
Subject: [PATCH 22/47] add : `BeniniII` metric.

---
 pycm/pycm_distance.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 7fd376e1..5d3f9b82 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -34,6 +34,7 @@ class DistanceType(Enum):
     BaulieuXIV = "BaulieuXIV"
     BaulieuXV = "BaulieuXV"
     BeniniI = "BeniniI"
+    BeniniII = "BeniniII"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -500,6 +501,27 @@ def BeniniI_calc(TP, FP, FN, TN):
         return "None"
 
 
+def BeniniII_calc(TP, FP, FN, TN):
+    """
+    Calculate Benini II correlation.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Benini II correlation as float
+    """
+    try:
+        part2 = min((TP + FN) * (FN + TN), (TP + FP) * (FP + TN))
+        return (TP * TN - FP * FN) / part2
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -523,4 +545,5 @@ def BeniniI_calc(TP, FP, FN, TN):
     DistanceType.BaulieuXIV: BaulieuXIV_calc,
     DistanceType.BaulieuXV: BaulieuXV_calc,
     DistanceType.BeniniI: BeniniI_calc,
+    DistanceType.BeniniII: BeniniII_calc,
     }

From 474ef73b3427e9a2fafb2c36c4372235a29e2ebe Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 14:23:41 +0330
Subject: [PATCH 23/47] add : `Canberra` metric.

---
 pycm/pycm_distance.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 5d3f9b82..15a819c9 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -35,6 +35,7 @@ class DistanceType(Enum):
     BaulieuXV = "BaulieuXV"
     BeniniI = "BeniniI"
     BeniniII = "BeniniII"
+    Canberra = "Canberra"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -522,6 +523,26 @@ def BeniniII_calc(TP, FP, FN, TN):
         return "None"
 
 
+def Canberra_calc(TP, FP, FN, TN):
+    """
+    Calculate Canberra distance.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Canberra distance as float
+    """
+    try:
+        return (FP + FN) / ((TP + FP) + (TP + FN))
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -546,4 +567,5 @@ def BeniniII_calc(TP, FP, FN, TN):
     DistanceType.BaulieuXV: BaulieuXV_calc,
     DistanceType.BeniniI: BeniniI_calc,
     DistanceType.BeniniII: BeniniII_calc,
+    DistanceType.Canberra: Canberra_calc,
     }

From 5d8282d094594f5c00d0cfd88c2815a87721e45d Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 14:28:16 +0330
Subject: [PATCH 24/47] add : `Clement` metric.

---
 pycm/pycm_distance.py | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 15a819c9..ad347d62 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -36,6 +36,7 @@ class DistanceType(Enum):
     BeniniI = "BeniniI"
     BeniniII = "BeniniII"
     Canberra = "Canberra"
+    Clement = "Clement"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -543,6 +544,29 @@ def Canberra_calc(TP, FP, FN, TN):
         return "None"
 
 
+def Clement_calc(TP, FP, FN, TN):
+    """
+    Calculate Clement similarity.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Clement similarity as float
+    """
+    try:
+        n = TP + FP + FN + TN
+        term1 = (TP / (TP + FP)) * (1 - (TP + FP) / n)
+        term2 = (TN / (FN + TN)) * (1 - (FN + TN) / n)
+        return term1 + term2
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -568,4 +592,5 @@ def Canberra_calc(TP, FP, FN, TN):
     DistanceType.BeniniI: BeniniI_calc,
     DistanceType.BeniniII: BeniniII_calc,
     DistanceType.Canberra: Canberra_calc,
+    DistanceType.Clement: Clement_calc,
     }

From a8bd8438b072f03cd01f7bd08d1b63dc08122fad Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 14:31:12 +0330
Subject: [PATCH 25/47] add : `ConsonniTodeschiniI` metric.

---
 pycm/pycm_distance.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index ad347d62..12658a27 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -37,6 +37,7 @@ class DistanceType(Enum):
     BeniniII = "BeniniII"
     Canberra = "Canberra"
     Clement = "Clement"
+    ConsonniTodeschiniI = "ConsonniTodeschiniI"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -567,6 +568,27 @@ def Clement_calc(TP, FP, FN, TN):
         return "None"
 
 
+def ConsonniTodeschiniI_calc(TP, FP, FN, TN):
+    """
+    Calculate Consonni & Todeschini I similarity.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Consonni & Todeschini I similarity as float
+    """
+    try:
+        n = TP + FP + FN + TN
+        return math.log(1 + TP + TN) / math.log(1 + n)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -593,4 +615,5 @@ def Clement_calc(TP, FP, FN, TN):
     DistanceType.BeniniII: BeniniII_calc,
     DistanceType.Canberra: Canberra_calc,
     DistanceType.Clement: Clement_calc,
+    DistanceType.ConsonniTodeschiniI: ConsonniTodeschiniI_calc,
     }

From 420cd662be9d316e6954a6af5d983c593e9b48af Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 14:34:23 +0330
Subject: [PATCH 26/47] add : `ConsonniTodeschiniII` metric.

---
 pycm/pycm_distance.py | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 12658a27..d15cec7c 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -38,6 +38,7 @@ class DistanceType(Enum):
     Canberra = "Canberra"
     Clement = "Clement"
     ConsonniTodeschiniI = "ConsonniTodeschiniI"
+    ConsonniTodeschiniII = "ConsonniTodeschiniII"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -589,6 +590,28 @@ def ConsonniTodeschiniI_calc(TP, FP, FN, TN):
         return "None"
 
 
+def ConsonniTodeschiniII_calc(TP, FP, FN, TN):
+    """
+    Calculate Consonni & Todeschini II similarity.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Consonni & Todeschini II similarity as float
+    """
+    try:
+        n = TP + FP + FN + TN
+        part1 = math.log(1 + n) - math.log(1 + FP + FN)
+        return part1 / math.log(1 + n)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -616,4 +639,5 @@ def ConsonniTodeschiniI_calc(TP, FP, FN, TN):
     DistanceType.Canberra: Canberra_calc,
     DistanceType.Clement: Clement_calc,
     DistanceType.ConsonniTodeschiniI: ConsonniTodeschiniI_calc,
+    DistanceType.ConsonniTodeschiniII: ConsonniTodeschiniII_calc,
     }

From c947dee356be56d0eaa6c32888d5ee083a377ff2 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 14:36:28 +0330
Subject: [PATCH 27/47] add : `ConsonniTodeschiniIII` metric.

---
 pycm/pycm_distance.py | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index d15cec7c..57d444bc 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -39,6 +39,7 @@ class DistanceType(Enum):
     Clement = "Clement"
     ConsonniTodeschiniI = "ConsonniTodeschiniI"
     ConsonniTodeschiniII = "ConsonniTodeschiniII"
+    ConsonniTodeschiniIII = "ConsonniTodeschiniIII"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -612,6 +613,27 @@ def ConsonniTodeschiniII_calc(TP, FP, FN, TN):
         return "None"
 
 
+def ConsonniTodeschiniIII_calc(TP, FP, FN, TN):
+    """
+    Calculate Consonni & Todeschini III similarity.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Consonni & Todeschini III similarity as float
+    """
+    try:
+        n = TP + FP + FN + TN
+        return math.log(1 + TP) / math.log(1 + n)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -640,4 +662,5 @@ def ConsonniTodeschiniII_calc(TP, FP, FN, TN):
     DistanceType.Clement: Clement_calc,
     DistanceType.ConsonniTodeschiniI: ConsonniTodeschiniI_calc,
     DistanceType.ConsonniTodeschiniII: ConsonniTodeschiniII_calc,
+    DistanceType.ConsonniTodeschiniIII: ConsonniTodeschiniIII_calc,
     }

From c9bbc56e3c882bac0ff7d2bb6d74752dfb6155af Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 14:39:00 +0330
Subject: [PATCH 28/47] add : `ConsonniTodeschiniIV` metric.

---
 pycm/pycm_distance.py | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 57d444bc..c5876bfb 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -40,6 +40,7 @@ class DistanceType(Enum):
     ConsonniTodeschiniI = "ConsonniTodeschiniI"
     ConsonniTodeschiniII = "ConsonniTodeschiniII"
     ConsonniTodeschiniIII = "ConsonniTodeschiniIII"
+    ConsonniTodeschiniIV = "ConsonniTodeschiniIV"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -634,6 +635,26 @@ def ConsonniTodeschiniIII_calc(TP, FP, FN, TN):
         return "None"
 
 
+def ConsonniTodeschiniIV_calc(TP, FP, FN, TN):
+    """
+    Calculate Consonni & Todeschini IV similarity.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Consonni & Todeschini IV similarity as float
+    """
+    try:
+        return math.log(1 + TP) / math.log(1 + TP + FP + FN)
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -663,4 +684,5 @@ def ConsonniTodeschiniIII_calc(TP, FP, FN, TN):
     DistanceType.ConsonniTodeschiniI: ConsonniTodeschiniI_calc,
     DistanceType.ConsonniTodeschiniII: ConsonniTodeschiniII_calc,
     DistanceType.ConsonniTodeschiniIII: ConsonniTodeschiniIII_calc,
+    DistanceType.ConsonniTodeschiniIV: ConsonniTodeschiniIV_calc,
     }

From 625e697f460554b0787cb5834c657379694ca694 Mon Sep 17 00:00:00 2001
From: sadrasabouri <sabouri.sadra@gmail.com>
Date: Thu, 29 Dec 2022 14:42:13 +0330
Subject: [PATCH 29/47] add : `ConsonniTodeschiniV` metric.

---
 pycm/pycm_distance.py | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index c5876bfb..906a13f2 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -41,6 +41,7 @@ class DistanceType(Enum):
     ConsonniTodeschiniII = "ConsonniTodeschiniII"
     ConsonniTodeschiniIII = "ConsonniTodeschiniIII"
     ConsonniTodeschiniIV = "ConsonniTodeschiniIV"
+    ConsonniTodeschiniV = "ConsonniTodeschiniV"
 
 
 def AMPLE_calc(TP, FP, FN, TN):
@@ -655,6 +656,29 @@ def ConsonniTodeschiniIV_calc(TP, FP, FN, TN):
         return "None"
 
 
+def ConsonniTodeschiniV_calc(TP, FP, FN, TN):
+    """
+    Calculate Consonni & Todeschini V similarity.
+
+    :param TP: true positive
+    :type TP: int
+    :param TN: true negative
+    :type TN: int
+    :param FP: false positive
+    :type FP: int
+    :param FN: false negative
+    :type FN: int
+    :return: Consonni & Todeschini V similarity as float
+    """
+    try:
+        n = TP + FP + FN + TN
+        part1 = math.log(1 + TP * TN) - math.log(1 + FP * FN)
+        part2 = math.log(1 + n * n / 4)
+        return part1 / part2
+    except Exception:
+        return "None"
+
+
 DISTANCE_MAPPER = {
     DistanceType.AMPLE: AMPLE_calc,
     DistanceType.Anderberg: Anderberg_calc,
@@ -685,4 +709,5 @@ def ConsonniTodeschiniIV_calc(TP, FP, FN, TN):
     DistanceType.ConsonniTodeschiniII: ConsonniTodeschiniII_calc,
     DistanceType.ConsonniTodeschiniIII: ConsonniTodeschiniIII_calc,
     DistanceType.ConsonniTodeschiniIV: ConsonniTodeschiniIV_calc,
+    DistanceType.ConsonniTodeschiniV: ConsonniTodeschiniV_calc,
     }

From caaa4877a51c292b2074e7d803c7e18765cd039b Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Mon, 2 Jan 2023 09:52:32 +0330
Subject: [PATCH 30/47] doc : Distance.ipynb added

---
 Document/Distance.ipynb | 1643 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 1643 insertions(+)
 create mode 100644 Document/Distance.ipynb

diff --git a/Document/Distance.ipynb b/Document/Distance.ipynb
new file mode 100644
index 00000000..daa74dd8
--- /dev/null
+++ b/Document/Distance.ipynb
@@ -0,0 +1,1643 @@
+{
+ "cells": [
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<p  style=\"z-index: 101;background: #fde073;text-align: center;line-height: 2.5;overflow: hidden;font-size:22px;\">Please <a href=\"https://www.pycm.io/doc/#Cite\" target=\"_blank\">cite us</a> if you use the software</p>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# Distance/Similarity"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 1,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "from pycm import ConfusionMatrix, DistanceType"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "cm = ConfusionMatrix(matrix = {0: {0: 3, 1: 0, 2: 0}, 1: {0: 0, 1: 1, 2: 2}, 2: {0: 2, 1: 1, 2: 3}})"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$TP \\rightarrow True Positive$$\n",
+    "$$TN \\rightarrow True Negative$$\n",
+    "$$FP \\rightarrow False Positive$$\n",
+    "$$FN \\rightarrow False Negative$$\n",
+    "$$POP \\rightarrow Population$$"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## AMPLE"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "AMPLE similarity [[1]](#ref1) [[2]](#ref2)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{AMPLE}=|\\frac{TP}{TP+FP}-\\frac{FN}{FN+TN}|$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.6, 1: 0.3, 2: 0.17142857142857143}"
+      ]
+     },
+     "execution_count": 3,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.AMPLE)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Anderberg's D."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Anderberg's D [[3]](#ref3)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{Anderberg} =\n",
+    "\\frac{(max(TP,FP)+max(FN,TN)+max(TP,FN)+max(FP,TN))-\n",
+    "(max(TP+FP,FP+TN)+max(TP+FP,FN+TN))}{2\\times POP}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.16666666666666666, 1: 0.0, 2: 0.041666666666666664}"
+      ]
+     },
+     "execution_count": 4,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.Anderberg)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Andres & Marzo's Delta"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Andres & Marzo's Delta correlation [[4]](#ref4)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$corr_{AndresMarzo_\\Delta} = \\Delta =\n",
+    "\\frac{TP+TN-2 \\times \\sqrt{FP \\times FN}}{POP}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.8333333333333334, 1: 0.5142977396044842, 2: 0.17508504286947035}"
+      ]
+     },
+     "execution_count": 5,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.AndresMarzoDelta)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baroni-Urbani & Buser I"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baroni-Urbani & Buser I similarity [[5]](#ref5)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{BaroniUrbaniBuserI} =\n",
+    "\\frac{\\sqrt{TP\\times TN}+TP}{\\sqrt{TP\\times TN}+TP+FP+FN}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.79128784747792, 1: 0.5606601717798213, 2: 0.5638559245324765}"
+      ]
+     },
+     "execution_count": 6,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaroniUrbaniBuserI)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baroni-Urbani & Buser II"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baroni-Urbani & Buser II correlation [[5]](#ref5)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$corr_{BaroniUrbaniBuserII} =\n",
+    "\\frac{\\sqrt{TP \\times TN}+TP-FP-FN}{\\sqrt{TP \\times TN}+TP+FP+FN}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 7,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.58257569495584, 1: 0.12132034355964261, 2: 0.1277118490649528}"
+      ]
+     },
+     "execution_count": 7,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaroniUrbaniBuserII)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Batagelj & Bren"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Batagelj & Bren distance [[6]](#ref6)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BatageljBren} =\n",
+    "\\frac{FP \\times FN}{TP \\times TN}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 8,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.0, 1: 0.25, 2: 0.5}"
+      ]
+     },
+     "execution_count": 8,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BatageljBren)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu I"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu I distance [[7]](#ref7)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{BaulieuI} =\n",
+    "\\frac{(TP+FP) \\times (TP+FN)-TP^2}{(TP+FP) \\times (TP+FN)}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.4, 1: 0.8333333333333334, 2: 0.7}"
+      ]
+     },
+     "execution_count": 9,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuI)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu II"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu II similarity [[7]](#ref7)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{BaulieuII} =\n",
+    "\\frac{TP^2 \\times TN^2}{(TP+FP) \\times (TP+FN) \\times (FP+TN) \\times (FN+TN)}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.4666666666666667, 1: 0.11851851851851852, 2: 0.11428571428571428}"
+      ]
+     },
+     "execution_count": 10,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuII)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu III"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu III distance [[7]](#ref7)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{BaulieuIII} =\n",
+    "\\frac{POP^2 - 4 \\times (TP \\times TN-FP \\times FN)}{2 \\times POP^2}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.20833333333333334, 1: 0.4166666666666667, 2: 0.4166666666666667}"
+      ]
+     },
+     "execution_count": 11,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuIII)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu IV"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu IV distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuIV} = \\frac{FP+FN-(TP+\\frac{1}{2})\\times(TN+\\frac{1}{2})\\times TN  \\times k}{TN}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: -41.45702383161246, 1: -22.855395541901885, 2: -13.85431293274332}"
+      ]
+     },
+     "execution_count": 12,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuIV)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "* The default value of k is Euler's number $e$"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu V"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu V distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuV} = \\frac{FP+FN+1}{TP+FP+FN+1}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.5, 1: 0.8, 2: 0.6666666666666666}"
+      ]
+     },
+     "execution_count": 13,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuV)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu VI"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu VI distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuVI} = \\frac{FP+FN}{TP+FP+FN+1}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 14,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.3333333333333333, 1: 0.6, 2: 0.5555555555555556}"
+      ]
+     },
+     "execution_count": 14,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuVI)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu VII"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu VII distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuVII} = \\frac{FP+FN}{POP + TP \\times (TP-4)^2}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 15,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.13333333333333333, 1: 0.14285714285714285, 2: 0.3333333333333333}"
+      ]
+     },
+     "execution_count": 15,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuVII)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu VIII"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu VIII distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuVIII} = \\frac{(FP-FN)^2}{POP^2}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.027777777777777776, 1: 0.006944444444444444, 2: 0.006944444444444444}"
+      ]
+     },
+     "execution_count": 16,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuVIII)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu IX"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu IX distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuIX} = \\frac{FP+2 \\times FN}{TP+FP+2 \\times FN+TN}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.16666666666666666, 1: 0.35714285714285715, 2: 0.5333333333333333}"
+      ]
+     },
+     "execution_count": 17,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuIX)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu X"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu X distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuX} = \\frac{FP+FN+max(FP,FN)}{POP+max(FP,FN)}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 18,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.2857142857142857, 1: 0.35714285714285715, 2: 0.5333333333333333}"
+      ]
+     },
+     "execution_count": 18,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuX)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu XI"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu XI distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuXI} = \\frac{FP+FN}{FP+FN+TN}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 19,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.2222222222222222, 1: 0.2727272727272727, 2: 0.5555555555555556}"
+      ]
+     },
+     "execution_count": 19,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuXI)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu XII"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu XII distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuXII} = \\frac{FP+FN}{TP+FP+FN-1}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 20,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.5, 1: 1.0, 2: 0.7142857142857143}"
+      ]
+     },
+     "execution_count": 20,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuXII)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu XIII"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu XIII distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuXIII} = \\frac{FP+FN}{TP+FP+FN+TP \\times (TP-4)^2}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 21,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.25, 1: 0.23076923076923078, 2: 0.45454545454545453}"
+      ]
+     },
+     "execution_count": 21,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuXIII)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu XIV"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu XIV distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuXIV} = \\frac{FP+2 \\times FN}{TP+FP+2 \\times FN}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 22,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.4, 1: 0.8333333333333334, 2: 0.7272727272727273}"
+      ]
+     },
+     "execution_count": 22,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuXIV)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Baulieu XV"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Baulieu XV distance [[8]](#ref8)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$dist_{BaulieuXV} = \\frac{FP+FN+max(FP, FN)}{TP+FP+FN+max(FP, FN)}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 23,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.5714285714285714, 1: 0.8333333333333334, 2: 0.7272727272727273}"
+      ]
+     },
+     "execution_count": 23,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BaulieuXV)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Benini I"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Benini I correlation [[9]](#ref9)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$corr_{BeniniI} = \\frac{TP \\times TN-FP \\times FN}{(TP+FN)\\times(FN+TN)}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 24,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 1.0, 1: 0.2, 2: 0.14285714285714285}"
+      ]
+     },
+     "execution_count": 24,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BeniniI)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Benini II"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Benini II correlation [[9]](#ref9)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$corr_{BeniniII} = \\frac{TP \\times TN-FP \\times FN}{min((TP+FN)\\times(FN+TN), (TP+FP)\\times(FP+TN))}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 25,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 1.0, 1: 0.3333333333333333, 2: 0.2}"
+      ]
+     },
+     "execution_count": 25,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.BeniniII)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Canberra"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Canberra distance [[10]](#ref10) [[11]](#ref11)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{Canberra} =\n",
+    "\\frac{FP+FN}{(TP+FP)+(TP+FN)}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 26,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.25, 1: 0.6, 2: 0.45454545454545453}"
+      ]
+     },
+     "execution_count": 26,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.Canberra)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Clement"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Clement similarity [[12]](#ref12)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{Clement} =\n",
+    "\\frac{TP}{TP+FP}\\times\\Big(1 - \\frac{TP+FP}{POP}\\Big) +\n",
+    "\\frac{TN}{FN+TN}\\times\\Big(1 - \\frac{FN+TN}{POP}\\Big)$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 27,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.7666666666666666, 1: 0.55, 2: 0.588095238095238}"
+      ]
+     },
+     "execution_count": 27,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.Clement)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Consonni & Todeschini I"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Consonni & Todeschini I similarity [[13]](#ref13)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{ConsonniTodeschiniI} =\n",
+    "\\frac{log(1+TP+TN)}{log(1+POP)}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 28,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.9348704159880586, 1: 0.8977117175026231, 2: 0.8107144632819592}"
+      ]
+     },
+     "execution_count": 28,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.ConsonniTodeschiniI)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Consonni & Todeschini II"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Consonni & Todeschini II similarity [[13]](#ref13)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{ConsonniTodeschiniII} =\n",
+    "\\frac{log(1+POP)-log(1+FP+FN)}{log(1+POP)}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 29,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.5716826589686053, 1: 0.4595236911453605, 2: 0.3014445045412856}"
+      ]
+     },
+     "execution_count": 29,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.ConsonniTodeschiniII)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Consonni & Todeschini III"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Consonni & Todeschini III similarity [[13]](#ref13)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{ConsonniTodeschiniIII} =\n",
+    "\\frac{log(1+TP)}{log(1+POP)}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 30,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.5404763088546395, 1: 0.27023815442731974, 2: 0.5404763088546395}"
+      ]
+     },
+     "execution_count": 30,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.ConsonniTodeschiniIII)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Consonni & Todeschini IV"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Consonni & Todeschini IV similarity [[13]](#ref13)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$sim_{ConsonniTodeschiniIV} =\n",
+    "\\frac{log(1+TP)}{log(1+TP+FP+FN)}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 31,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.7737056144690831, 1: 0.43067655807339306, 2: 0.6309297535714574}"
+      ]
+     },
+     "execution_count": 31,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.ConsonniTodeschiniIV)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## Consonni & Todeschini V"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "Consonni & Todeschini V correlation [[13]](#ref13)."
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "$$corr_{ConsonniTodeschiniV} =\n",
+    "\\frac{log(1+TP \\times TN)-log(1+FP \\times FN)}{log(1+\\frac{POP^2}{4})}$$"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 32,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "{0: 0.8560267854703983, 1: 0.30424737289682985, 2: 0.17143541431350617}"
+      ]
+     },
+     "execution_count": 32,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "cm.distance(metric = DistanceType.ConsonniTodeschiniV)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## References"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<blockquote id=\"ref1\">1- Valentin Dallmeier, Christian Lindig, and Andreas Zeller. Lightweight. In ECOOP'05 Proceedings of the 19th European conference on Object-Oriented Programming. 2005. URL: https://www.st.cs.uni-saarland.de/papers/dlz2004/dlz2004.pdf, doi:10.1007/11531142\\_23.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref2\">2- Rui Abreu, Peter Zoeteweij, and Arjan J. C. van Gemund. An evaluation of similarity coefficients for software fault localization. In 2006 12th Pacific Rim International Symposium on Dependable Computing (PRDC'06). 2007. doi:10.1109/PRDC.2006.18.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref3\">3- Michael R. Anderberg. Cluster Analysis for Applications. Academic Press, New York, 1973. doi:10.1016/C2013-0-06161-0.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref4\">4- A. Martín Andrés and P. Femia Marzo. Delta: a new measure of agreement between two raters. British Journal of Mathematical and Statistical Psychology, 57(1):1–20, May 2004. doi:10.1348/000711004849268.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref5\">5- Cesare Baroni-Urbani and Mauro W. Buser. Similarity of binary data. Systematic Biology, 25(3):251–259, September 1976. doi:10.2307/2412493.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref6\">6- Vladimir Batagelj and Matevž Bren. Comparing resemblance measures. Journal of Classification, 12(1):73–90, March 1995. doi:10.1007/BF01202268.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref7\">7- Forrest B. Baulieu. A classification of presence/absence based dissimilarity coefficients. Journal of Classification, 6(1):233–246, 1989. doi:10.1007/BF01908601.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref8\">8- Forrest B. Baulieu. Two variant axiom systems for presence/absence based dissimilarity coefficients. Journal of Classification, 14(1):159–170, 1997. doi:10.1007/s003579900009.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref9\">9- Rudolfo Benini. Principii di Demografia. Number 29 in Manuali Barbera di Scienze Giuridiche Sociali e Politiche. G. Barbera, Firenze, 1901. URL: http://www.archive.org/stream/principiididemo00benigoog.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref10\">10- Godfrey N. Lance and William T. Williams. Computer programs for hierarchical polythetic classification (\"similarity analysis\"). Computer Journal, 1966. doi:10.1093/comjnl/9.1.60.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref11\">11- Godfrey N. Lance and William T. Williams. Mixed-data classificatory programs i. agglomerative systems. Australian Computer Journal, 1:15–20, 1967.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref12\">12- Paul W. Clement. A formula for computing inter-observer agreement. Psychological Reports, 39(1):257–258, 1976. doi:10.2466/pr0.1976.39.1.257.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref13\">13- Viviana Consonni and Roberto Todeschini. New similarity coefficients for binary data. MATCH Communications in Mathematical and in Computer Chemistry, 68:581–592, 2012.</blockquote>"
+   ]
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.5.2"
+  },
+  "toc": {
+   "base_numbering": 1,
+   "nav_menu": {},
+   "number_sections": false,
+   "sideBar": true,
+   "skip_h1_title": true,
+   "title_cell": "Table of Contents",
+   "title_sidebar": "Distance/Similarity",
+   "toc_cell": false,
+   "toc_position": {},
+   "toc_section_display": true,
+   "toc_window_display": false
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

From 8cf02b5312d828eea6c39d51d40b608cc34a090d Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Mon, 2 Jan 2023 09:54:35 +0330
Subject: [PATCH 31/47] fix : __init__.py updated

---
 pycm/__init__.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pycm/__init__.py b/pycm/__init__.py
index 7074fd4f..6d185842 100644
--- a/pycm/__init__.py
+++ b/pycm/__init__.py
@@ -3,6 +3,7 @@
 from .pycm_param import PYCM_VERSION, OVERALL_BENCHMARK_LIST, CLASS_BENCHMARK_LIST
 from .pycm_error import *
 from .pycm_output import pycm_help, online_help
+from .pycm_distance import DistanceType
 from .pycm_obj import ConfusionMatrix
 from .pycm_compare import Compare
 from .pycm_curve import Curve, ROCCurve, PRCurve

From f431c9d51f10c197ee5b87e1036cd4c7c10017ab Mon Sep 17 00:00:00 2001
From: alirezazolanvari <alireza.zolanvari93@gmail.com>
Date: Mon, 2 Jan 2023 12:10:22 +0100
Subject: [PATCH 32/47] reformat refs #349 #350

---
 Document/Distance.ipynb | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/Document/Distance.ipynb b/Document/Distance.ipynb
index daa74dd8..b0fb6212 100644
--- a/Document/Distance.ipynb
+++ b/Document/Distance.ipynb
@@ -1578,31 +1578,31 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "<blockquote id=\"ref1\">1- Valentin Dallmeier, Christian Lindig, and Andreas Zeller. Lightweight. In ECOOP'05 Proceedings of the 19th European conference on Object-Oriented Programming. 2005. URL: https://www.st.cs.uni-saarland.de/papers/dlz2004/dlz2004.pdf, doi:10.1007/11531142\\_23.</blockquote>\n",
+    "<blockquote id=\"ref1\">1- V. Dallmeier, C. Lindig, and A. Zeller, "Lightweight defect localization for Java," in <i>European conference on object-oriented programming</i>, 2005: Springer, pp. 528-550.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref2\">2- Rui Abreu, Peter Zoeteweij, and Arjan J. C. van Gemund. An evaluation of similarity coefficients for software fault localization. In 2006 12th Pacific Rim International Symposium on Dependable Computing (PRDC'06). 2007. doi:10.1109/PRDC.2006.18.</blockquote>\n",
+    "<blockquote id=\"ref2\">2- R. Abreu, P. Zoeteweij, and A. J. Van Gemund, "An evaluation of similarity coefficients for software fault localization," in 2006 <i>12th Pacific Rim International Symposium on Dependable Computing (PRDC'06)</i>, 2006: IEEE, pp. 39-46.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref3\">3- Michael R. Anderberg. Cluster Analysis for Applications. Academic Press, New York, 1973. doi:10.1016/C2013-0-06161-0.</blockquote>\n",
+    "<blockquote id=\"ref3\">3- M. R. Anderberg, <i>Cluster analysis for applications: probability and mathematical statistics: a series of monographs and textbooks</i>. Academic press, 2014.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref4\">4- A. Martín Andrés and P. Femia Marzo. Delta: a new measure of agreement between two raters. British Journal of Mathematical and Statistical Psychology, 57(1):1–20, May 2004. doi:10.1348/000711004849268.</blockquote>\n",
+    "<blockquote id=\"ref4\">4- A. M. Andrés and P. F. Marzo, "Delta: A new measure of agreement between two raters," <i>British journal of mathematical and statistical psychology</i>, vol. 57, no. 1, pp. 1-19, 2004.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref5\">5- Cesare Baroni-Urbani and Mauro W. Buser. Similarity of binary data. Systematic Biology, 25(3):251–259, September 1976. doi:10.2307/2412493.</blockquote>\n",
+    "<blockquote id=\"ref5\">5- C. Baroni-Urbani and M. W. Buser, "Similarity of binary data," <i>Systematic Zoology</i>, vol. 25, no. 3, pp. 251-259, 1976.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref6\">6- Vladimir Batagelj and Matevž Bren. Comparing resemblance measures. Journal of Classification, 12(1):73–90, March 1995. doi:10.1007/BF01202268.</blockquote>\n",
+    "<blockquote id=\"ref6\">6- V. Batagelj and M. Bren, "Comparing resemblance measures," <i>Journal of classification</i>, vol. 12, no. 1, pp. 73-90, 1995.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref7\">7- Forrest B. Baulieu. A classification of presence/absence based dissimilarity coefficients. Journal of Classification, 6(1):233–246, 1989. doi:10.1007/BF01908601.</blockquote>\n",
+    "<blockquote id=\"ref7\">7- F. B. Baulieu, "A classification of presence/absence based dissimilarity coefficients," <i>Journal of Classification</i>, vol. 6, no. 1, pp. 233-246, 1989.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref8\">8- Forrest B. Baulieu. Two variant axiom systems for presence/absence based dissimilarity coefficients. Journal of Classification, 14(1):159–170, 1997. doi:10.1007/s003579900009.</blockquote>\n",
+    "<blockquote id=\"ref8\">8- F. B. Baulieu, "Two variant axiom systems for presence/absence based dissimilarity coefficients," <i>Journal of Classification</i>, vol. 14, no. 1, pp. 0159-0170, 1997.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref9\">9- Rudolfo Benini. Principii di Demografia. Number 29 in Manuali Barbera di Scienze Giuridiche Sociali e Politiche. G. Barbera, Firenze, 1901. URL: http://www.archive.org/stream/principiididemo00benigoog.</blockquote>\n",
+    "<blockquote id=\"ref9\">9- R. Benini, <i>Principii di demografia</i>. Barbera, 1901.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref10\">10- Godfrey N. Lance and William T. Williams. Computer programs for hierarchical polythetic classification (\"similarity analysis\"). Computer Journal, 1966. doi:10.1093/comjnl/9.1.60.</blockquote>\n",
+    "<blockquote id=\"ref10\">10- G. N. Lance and W. T. Williams, "Computer programs for hierarchical polythetic classification (“similarity analyses”)," <i>The Computer Journal</i>, vol. 9, no. 1, pp. 60-64, 1966.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref11\">11- Godfrey N. Lance and William T. Williams. Mixed-data classificatory programs i. agglomerative systems. Australian Computer Journal, 1:15–20, 1967.</blockquote>\n",
+    "<blockquote id=\"ref11\">11- G. N. Lance and W. T. Williams, "Mixed-Data Classificatory Programs I - Agglomerative Systems," <i>Australian Computer Journal</i>, vol. 1, no. 1, pp. 15-20, 1967.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref12\">12- Paul W. Clement. A formula for computing inter-observer agreement. Psychological Reports, 39(1):257–258, 1976. doi:10.2466/pr0.1976.39.1.257.</blockquote>\n",
+    "<blockquote id=\"ref12\">12- P. W. Clement, "A formula for computing inter-observer agreement," <i>Psychological Reports</i>, vol. 39, no. 1, pp. 257-258, 1976.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref13\">13- Viviana Consonni and Roberto Todeschini. New similarity coefficients for binary data. MATCH Communications in Mathematical and in Computer Chemistry, 68:581–592, 2012.</blockquote>"
+    "<blockquote id=\"ref13\">13- V. Consonni and R. Todeschini, "New similarity coefficients for binary data," <i>Match-Communications in Mathematical and Computer Chemistry</i>, vol. 68, no. 2, p. 581, 2012.</blockquote>"
    ]
   }
  ],

From 11e7fe9385bee5a523db9660f567497776e239b2 Mon Sep 17 00:00:00 2001
From: alirezazolanvari <alireza.zolanvari93@gmail.com>
Date: Mon, 2 Jan 2023 23:01:37 +0100
Subject: [PATCH 33/47] Add Abydos ref #349 #350

---
 Document/Distance.ipynb | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/Document/Distance.ipynb b/Document/Distance.ipynb
index b0fb6212..febb7a5f 100644
--- a/Document/Distance.ipynb
+++ b/Document/Distance.ipynb
@@ -1578,31 +1578,33 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "<blockquote id=\"ref1\">1- V. Dallmeier, C. Lindig, and A. Zeller, "Lightweight defect localization for Java," in <i>European conference on object-oriented programming</i>, 2005: Springer, pp. 528-550.</blockquote>\n",
+   "<blockquote id=\"ref1\">1- C. C. Little, "Abydos Documentation," 2018.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref2\">2- R. Abreu, P. Zoeteweij, and A. J. Van Gemund, "An evaluation of similarity coefficients for software fault localization," in 2006 <i>12th Pacific Rim International Symposium on Dependable Computing (PRDC'06)</i>, 2006: IEEE, pp. 39-46.</blockquote>\n",
+    "<blockquote id=\"ref1\">2- V. Dallmeier, C. Lindig, and A. Zeller, "Lightweight defect localization for Java," in <i>European conference on object-oriented programming</i>, 2005: Springer, pp. 528-550.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref3\">3- M. R. Anderberg, <i>Cluster analysis for applications: probability and mathematical statistics: a series of monographs and textbooks</i>. Academic press, 2014.</blockquote>\n",
+    "<blockquote id=\"ref2\">3- R. Abreu, P. Zoeteweij, and A. J. Van Gemund, "An evaluation of similarity coefficients for software fault localization," in 2006 <i>12th Pacific Rim International Symposium on Dependable Computing (PRDC'06)</i>, 2006: IEEE, pp. 39-46.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref4\">4- A. M. Andrés and P. F. Marzo, "Delta: A new measure of agreement between two raters," <i>British journal of mathematical and statistical psychology</i>, vol. 57, no. 1, pp. 1-19, 2004.</blockquote>\n",
+    "<blockquote id=\"ref3\">4- M. R. Anderberg, <i>Cluster analysis for applications: probability and mathematical statistics: a series of monographs and textbooks</i>. Academic press, 2014.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref5\">5- C. Baroni-Urbani and M. W. Buser, "Similarity of binary data," <i>Systematic Zoology</i>, vol. 25, no. 3, pp. 251-259, 1976.</blockquote>\n",
+    "<blockquote id=\"ref4\">5- A. M. Andrés and P. F. Marzo, "Delta: A new measure of agreement between two raters," <i>British journal of mathematical and statistical psychology</i>, vol. 57, no. 1, pp. 1-19, 2004.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref6\">6- V. Batagelj and M. Bren, "Comparing resemblance measures," <i>Journal of classification</i>, vol. 12, no. 1, pp. 73-90, 1995.</blockquote>\n",
+    "<blockquote id=\"ref5\">6- C. Baroni-Urbani and M. W. Buser, "Similarity of binary data," <i>Systematic Zoology</i>, vol. 25, no. 3, pp. 251-259, 1976.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref7\">7- F. B. Baulieu, "A classification of presence/absence based dissimilarity coefficients," <i>Journal of Classification</i>, vol. 6, no. 1, pp. 233-246, 1989.</blockquote>\n",
+    "<blockquote id=\"ref6\">7- V. Batagelj and M. Bren, "Comparing resemblance measures," <i>Journal of classification</i>, vol. 12, no. 1, pp. 73-90, 1995.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref8\">8- F. B. Baulieu, "Two variant axiom systems for presence/absence based dissimilarity coefficients," <i>Journal of Classification</i>, vol. 14, no. 1, pp. 0159-0170, 1997.</blockquote>\n",
+    "<blockquote id=\"ref7\">8- F. B. Baulieu, "A classification of presence/absence based dissimilarity coefficients," <i>Journal of Classification</i>, vol. 6, no. 1, pp. 233-246, 1989.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref9\">9- R. Benini, <i>Principii di demografia</i>. Barbera, 1901.</blockquote>\n",
+    "<blockquote id=\"ref8\">9- F. B. Baulieu, "Two variant axiom systems for presence/absence based dissimilarity coefficients," <i>Journal of Classification</i>, vol. 14, no. 1, pp. 0159-0170, 1997.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref10\">10- G. N. Lance and W. T. Williams, "Computer programs for hierarchical polythetic classification (“similarity analyses”)," <i>The Computer Journal</i>, vol. 9, no. 1, pp. 60-64, 1966.</blockquote>\n",
+    "<blockquote id=\"ref9\">10- R. Benini, <i>Principii di demografia</i>. Barbera, 1901.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref11\">11- G. N. Lance and W. T. Williams, "Mixed-Data Classificatory Programs I - Agglomerative Systems," <i>Australian Computer Journal</i>, vol. 1, no. 1, pp. 15-20, 1967.</blockquote>\n",
+    "<blockquote id=\"ref10\">11- G. N. Lance and W. T. Williams, "Computer programs for hierarchical polythetic classification (“similarity analyses”)," <i>The Computer Journal</i>, vol. 9, no. 1, pp. 60-64, 1966.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref12\">12- P. W. Clement, "A formula for computing inter-observer agreement," <i>Psychological Reports</i>, vol. 39, no. 1, pp. 257-258, 1976.</blockquote>\n",
+    "<blockquote id=\"ref11\">12- G. N. Lance and W. T. Williams, "Mixed-Data Classificatory Programs I - Agglomerative Systems," <i>Australian Computer Journal</i>, vol. 1, no. 1, pp. 15-20, 1967.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref13\">13- V. Consonni and R. Todeschini, "New similarity coefficients for binary data," <i>Match-Communications in Mathematical and Computer Chemistry</i>, vol. 68, no. 2, p. 581, 2012.</blockquote>"
+    "<blockquote id=\"ref12\">13- P. W. Clement, "A formula for computing inter-observer agreement," <i>Psychological Reports</i>, vol. 39, no. 1, pp. 257-258, 1976.</blockquote>\n",
+    "\n",
+    "<blockquote id=\"ref13\">14- V. Consonni and R. Todeschini, "New similarity coefficients for binary data," <i>Match-Communications in Mathematical and Computer Chemistry</i>, vol. 68, no. 2, p. 581, 2012.</blockquote>"
    ]
   }
  ],

From baaf5abfb06f8a57088cf2b5cc6e82bab7a58fe2 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Tue, 3 Jan 2023 11:47:19 +0330
Subject: [PATCH 34/47] doc : Distance.ipynb updated

---
 Document/Distance.ipynb | 95 ++++++++++++++++++++++-------------------
 1 file changed, 51 insertions(+), 44 deletions(-)

diff --git a/Document/Distance.ipynb b/Document/Distance.ipynb
index febb7a5f..066af5d1 100644
--- a/Document/Distance.ipynb
+++ b/Document/Distance.ipynb
@@ -14,6 +14,13 @@
     "# Distance/Similarity"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "PyCM's `distance` method provides users with a wide range of string distance/similarity metrics to evaluate a confusion matrix by measuring its distance to a perfect confusion matrix. Distance/Similarity metrics measure the distance between two vectors of numbers. Small distances between two objects indicate similarity. In the PyCM's `distance` method, a distance measure can be chosen from `DistanceType`. The measures' names are chosen based on the namig style suggested in [[1]](#ref1)."
+   ]
+  },
   {
    "cell_type": "code",
    "execution_count": 1,
@@ -54,7 +61,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "AMPLE similarity [[1]](#ref1) [[2]](#ref2)."
+    "AMPLE similarity [[2]](#ref2) [[3]](#ref3)."
    ]
   },
   {
@@ -104,7 +111,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Anderberg's D [[3]](#ref3)."
+    "Anderberg's D [[4]](#ref4)."
    ]
   },
   {
@@ -156,7 +163,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Andres & Marzo's Delta correlation [[4]](#ref4)."
+    "Andres & Marzo's Delta correlation [[5]](#ref5)."
    ]
   },
   {
@@ -207,7 +214,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baroni-Urbani & Buser I similarity [[5]](#ref5)."
+    "Baroni-Urbani & Buser I similarity [[6]](#ref6)."
    ]
   },
   {
@@ -258,7 +265,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baroni-Urbani & Buser II correlation [[5]](#ref5)."
+    "Baroni-Urbani & Buser II correlation [[6]](#ref6)."
    ]
   },
   {
@@ -309,7 +316,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Batagelj & Bren distance [[6]](#ref6)."
+    "Batagelj & Bren distance [[7]](#ref7)."
    ]
   },
   {
@@ -360,7 +367,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu I distance [[7]](#ref7)."
+    "Baulieu I distance [[8]](#ref8)."
    ]
   },
   {
@@ -411,7 +418,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu II similarity [[7]](#ref7)."
+    "Baulieu II similarity [[8]](#ref8)."
    ]
   },
   {
@@ -462,7 +469,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu III distance [[7]](#ref7)."
+    "Baulieu III distance [[8]](#ref8)."
    ]
   },
   {
@@ -513,7 +520,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu IV distance [[8]](#ref8)."
+    "Baulieu IV distance [[9]](#ref9)."
    ]
   },
   {
@@ -570,7 +577,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu V distance [[8]](#ref8)."
+    "Baulieu V distance [[9]](#ref9)."
    ]
   },
   {
@@ -620,7 +627,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu VI distance [[8]](#ref8)."
+    "Baulieu VI distance [[9]](#ref9)."
    ]
   },
   {
@@ -670,7 +677,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu VII distance [[8]](#ref8)."
+    "Baulieu VII distance [[9]](#ref9)."
    ]
   },
   {
@@ -720,7 +727,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu VIII distance [[8]](#ref8)."
+    "Baulieu VIII distance [[9]](#ref9)."
    ]
   },
   {
@@ -770,7 +777,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu IX distance [[8]](#ref8)."
+    "Baulieu IX distance [[9]](#ref9)."
    ]
   },
   {
@@ -820,7 +827,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu X distance [[8]](#ref8)."
+    "Baulieu X distance [[9]](#ref9)."
    ]
   },
   {
@@ -870,7 +877,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu XI distance [[8]](#ref8)."
+    "Baulieu XI distance [[9]](#ref9)."
    ]
   },
   {
@@ -920,7 +927,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu XII distance [[8]](#ref8)."
+    "Baulieu XII distance [[9]](#ref9)."
    ]
   },
   {
@@ -970,7 +977,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu XIII distance [[8]](#ref8)."
+    "Baulieu XIII distance [[9]](#ref9)."
    ]
   },
   {
@@ -1020,7 +1027,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu XIV distance [[8]](#ref8)."
+    "Baulieu XIV distance [[9]](#ref9)."
    ]
   },
   {
@@ -1070,7 +1077,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Baulieu XV distance [[8]](#ref8)."
+    "Baulieu XV distance [[9]](#ref9)."
    ]
   },
   {
@@ -1120,7 +1127,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Benini I correlation [[9]](#ref9)."
+    "Benini I correlation [[10]](#ref10)."
    ]
   },
   {
@@ -1170,7 +1177,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Benini II correlation [[9]](#ref9)."
+    "Benini II correlation [[10]](#ref10)."
    ]
   },
   {
@@ -1220,7 +1227,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Canberra distance [[10]](#ref10) [[11]](#ref11)."
+    "Canberra distance [[11]](#ref11) [[12]](#ref12)."
    ]
   },
   {
@@ -1271,7 +1278,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Clement similarity [[12]](#ref12)."
+    "Clement similarity [[13]](#ref13)."
    ]
   },
   {
@@ -1323,7 +1330,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Consonni & Todeschini I similarity [[13]](#ref13)."
+    "Consonni & Todeschini I similarity [[14]](#ref14)."
    ]
   },
   {
@@ -1374,7 +1381,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Consonni & Todeschini II similarity [[13]](#ref13)."
+    "Consonni & Todeschini II similarity [[14]](#ref14)."
    ]
   },
   {
@@ -1425,7 +1432,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Consonni & Todeschini III similarity [[13]](#ref13)."
+    "Consonni & Todeschini III similarity [[14]](#ref14)."
    ]
   },
   {
@@ -1476,7 +1483,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Consonni & Todeschini IV similarity [[13]](#ref13)."
+    "Consonni & Todeschini IV similarity [[14]](#ref14)."
    ]
   },
   {
@@ -1527,7 +1534,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "Consonni & Todeschini V correlation [[13]](#ref13)."
+    "Consonni & Todeschini V correlation [[14]](#ref14)."
    ]
   },
   {
@@ -1578,33 +1585,33 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-   "<blockquote id=\"ref1\">1- C. C. Little, "Abydos Documentation," 2018.</blockquote>\n",
+    "<blockquote id=\"ref1\">1- C. C. Little, \"Abydos Documentation,\" 2018.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref1\">2- V. Dallmeier, C. Lindig, and A. Zeller, "Lightweight defect localization for Java," in <i>European conference on object-oriented programming</i>, 2005: Springer, pp. 528-550.</blockquote>\n",
+    "<blockquote id=\"ref2\">2- V. Dallmeier, C. Lindig, and A. Zeller, \"Lightweight defect localization for Java,\" in <i>European conference on object-oriented programming</i>, 2005: Springer, pp. 528-550.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref2\">3- R. Abreu, P. Zoeteweij, and A. J. Van Gemund, "An evaluation of similarity coefficients for software fault localization," in 2006 <i>12th Pacific Rim International Symposium on Dependable Computing (PRDC'06)</i>, 2006: IEEE, pp. 39-46.</blockquote>\n",
+    "<blockquote id=\"ref3\">3- R. Abreu, P. Zoeteweij, and A. J. Van Gemund, \"An evaluation of similarity coefficients for software fault localization,\" in 2006 <i>12th Pacific Rim International Symposium on Dependable Computing (PRDC'06)</i>, 2006: IEEE, pp. 39-46.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref3\">4- M. R. Anderberg, <i>Cluster analysis for applications: probability and mathematical statistics: a series of monographs and textbooks</i>. Academic press, 2014.</blockquote>\n",
+    "<blockquote id=\"ref4\">4- M. R. Anderberg, <i>Cluster analysis for applications: probability and mathematical statistics: a series of monographs and textbooks</i>. Academic press, 2014.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref4\">5- A. M. Andrés and P. F. Marzo, "Delta: A new measure of agreement between two raters," <i>British journal of mathematical and statistical psychology</i>, vol. 57, no. 1, pp. 1-19, 2004.</blockquote>\n",
+    "<blockquote id=\"ref5\">5- A. M. Andrés and P. F. Marzo, \"Delta: A new measure of agreement between two raters,\" <i>British journal of mathematical and statistical psychology</i>, vol. 57, no. 1, pp. 1-19, 2004.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref5\">6- C. Baroni-Urbani and M. W. Buser, "Similarity of binary data," <i>Systematic Zoology</i>, vol. 25, no. 3, pp. 251-259, 1976.</blockquote>\n",
+    "<blockquote id=\"ref6\">6- C. Baroni-Urbani and M. W. Buser, \"Similarity of binary data,\" <i>Systematic Zoology</i>, vol. 25, no. 3, pp. 251-259, 1976.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref6\">7- V. Batagelj and M. Bren, "Comparing resemblance measures," <i>Journal of classification</i>, vol. 12, no. 1, pp. 73-90, 1995.</blockquote>\n",
+    "<blockquote id=\"ref7\">7- V. Batagelj and M. Bren, \"Comparing resemblance measures,\" <i>Journal of classification</i>, vol. 12, no. 1, pp. 73-90, 1995.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref7\">8- F. B. Baulieu, "A classification of presence/absence based dissimilarity coefficients," <i>Journal of Classification</i>, vol. 6, no. 1, pp. 233-246, 1989.</blockquote>\n",
+    "<blockquote id=\"ref8\">8- F. B. Baulieu, \"A classification of presence/absence based dissimilarity coefficients,\" <i>Journal of Classification</i>, vol. 6, no. 1, pp. 233-246, 1989.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref8\">9- F. B. Baulieu, "Two variant axiom systems for presence/absence based dissimilarity coefficients," <i>Journal of Classification</i>, vol. 14, no. 1, pp. 0159-0170, 1997.</blockquote>\n",
+    "<blockquote id=\"ref9\">9- F. B. Baulieu, \"Two variant axiom systems for presence/absence based dissimilarity coefficients,\" <i>Journal of Classification</i>, vol. 14, no. 1, pp. 0159-0170, 1997.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref9\">10- R. Benini, <i>Principii di demografia</i>. Barbera, 1901.</blockquote>\n",
+    "<blockquote id=\"ref10\">10- R. Benini, <i>Principii di demografia</i>. Barbera, 1901.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref10\">11- G. N. Lance and W. T. Williams, "Computer programs for hierarchical polythetic classification (“similarity analyses”)," <i>The Computer Journal</i>, vol. 9, no. 1, pp. 60-64, 1966.</blockquote>\n",
+    "<blockquote id=\"ref11\">11- G. N. Lance and W. T. Williams, \"Computer programs for hierarchical polythetic classification (“similarity analyses”),\" <i>The Computer Journal</i>, vol. 9, no. 1, pp. 60-64, 1966.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref11\">12- G. N. Lance and W. T. Williams, "Mixed-Data Classificatory Programs I - Agglomerative Systems," <i>Australian Computer Journal</i>, vol. 1, no. 1, pp. 15-20, 1967.</blockquote>\n",
+    "<blockquote id=\"ref12\">12- G. N. Lance and W. T. Williams, \"Mixed-Data Classificatory Programs I - Agglomerative Systems,\" <i>Australian Computer Journal</i>, vol. 1, no. 1, pp. 15-20, 1967.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref12\">13- P. W. Clement, "A formula for computing inter-observer agreement," <i>Psychological Reports</i>, vol. 39, no. 1, pp. 257-258, 1976.</blockquote>\n",
+    "<blockquote id=\"ref13\">13- P. W. Clement, \"A formula for computing inter-observer agreement,\" <i>Psychological Reports</i>, vol. 39, no. 1, pp. 257-258, 1976.</blockquote>\n",
     "\n",
-    "<blockquote id=\"ref13\">14- V. Consonni and R. Todeschini, "New similarity coefficients for binary data," <i>Match-Communications in Mathematical and Computer Chemistry</i>, vol. 68, no. 2, p. 581, 2012.</blockquote>"
+    "<blockquote id=\"ref14\">14- V. Consonni and R. Todeschini, \"New similarity coefficients for binary data,\" <i>Match-Communications in Mathematical and Computer Chemistry</i>, vol. 68, no. 2, p. 581, 2012.</blockquote>"
    ]
   }
  ],

From ed66ead2c45a68d1fdd9fc19705aef3a1cb34837 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Tue, 3 Jan 2023 12:43:43 +0330
Subject: [PATCH 35/47] fix : verified_test.py updated

---
 Test/verified_test.py | 123 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 123 insertions(+)

diff --git a/Test/verified_test.py b/Test/verified_test.py
index 3c963640..17ad3c10 100644
--- a/Test/verified_test.py
+++ b/Test/verified_test.py
@@ -427,4 +427,127 @@
 True
 >>> abs(crv.area(method="midpoint")[2] - 0.2916) < 0.001
 True
+>>> cm1 = ConfusionMatrix(matrix = {1:{1:2,0:2},0:{0:778,1:2}})  # Verified Case -- (https://bit.ly/3BVdNBp)
+>>> cm2 = ConfusionMatrix(matrix = {1:{1:2,0:3},0:{0:775,1:4}})  # Verified Case -- (https://bit.ly/3BVdNBp)
+>>> cm1.distance(metric=DistanceType.AMPLE)[1]
+0.49743589743589745
+>>> cm2.distance(metric=DistanceType.AMPLE)[1]
+0.32947729220222793
+>>> cm1.distance(metric=DistanceType.Anderberg)[1]
+0.0
+>>> cm2.distance(metric=DistanceType.Anderberg)[1]
+0.0
+>>> cm1.distance(metric=DistanceType.AndresMarzoDelta)[1]
+0.9897959183673469
+>>> cm2.distance(metric=DistanceType.AndresMarzoDelta)[1]
+0.9822344346552608
+>>> cm1.distance(metric=DistanceType.BaroniUrbaniBuserI)[1]
+0.9119837740878104
+>>> cm2.distance(metric=DistanceType.BaroniUrbaniBuserI)[1]
+0.8552823175014205
+>>> cm1.distance(metric=DistanceType.BaroniUrbaniBuserII)[1]
+0.8239675481756209
+>>> cm2.distance(metric=DistanceType.BaroniUrbaniBuserII)[1]
+0.7105646350028408
+>>> cm1.distance(metric=DistanceType.BatageljBren)[1]
+0.002570694087403599
+>>> cm2.distance(metric=DistanceType.BatageljBren)[1]
+0.007741935483870968
+>>> cm1.distance(metric=DistanceType.BaulieuI)[1]
+0.75
+>>> cm2.distance(metric=DistanceType.BaulieuI)[1]
+0.8666666666666667
+>>> cm1.distance(metric=DistanceType.BaulieuII)[1]
+0.24871959237343852
+>>> cm2.distance(metric=DistanceType.BaulieuII)[1]
+0.13213719608444902
+>>> cm1.distance(metric=DistanceType.BaulieuIII)[1]
+0.4949500208246564
+>>> cm2.distance(metric=DistanceType.BaulieuIII)[1]
+0.4949955747605165
+>>> cm1.distance(metric=DistanceType.BaulieuIV)[1]
+-5249.96272285802
+>>> cm2.distance(metric=DistanceType.BaulieuIV)[1]
+-5209.561726488335
+>>> cm1.distance(metric=DistanceType.BaulieuV)[1]
+0.7142857142857143
+>>> cm2.distance(metric=DistanceType.BaulieuV)[1]
+0.8
+>>> cm1.distance(metric=DistanceType.BaulieuVI)[1]
+0.5714285714285714
+>>> cm2.distance(metric=DistanceType.BaulieuVI)[1]
+0.7
+>>> cm1.distance(metric=DistanceType.BaulieuVII)[1]
+0.005050505050505051
+>>> cm2.distance(metric=DistanceType.BaulieuVII)[1]
+0.008838383838383838
+>>> cm1.distance(metric=DistanceType.BaulieuVIII)[1]
+0.0
+>>> cm2.distance(metric=DistanceType.BaulieuVIII)[1]
+1.6269262807163682e-06
+>>> cm1.distance(metric=DistanceType.BaulieuIX)[1]
+0.007633587786259542
+>>> cm2.distance(metric=DistanceType.BaulieuIX)[1]
+0.012706480304955527
+>>> cm1.distance(metric=DistanceType.BaulieuX)[1]
+0.007633587786259542
+>>> cm2.distance(metric=DistanceType.BaulieuX)[1]
+0.013959390862944163
+>>> cm1.distance(metric=DistanceType.BaulieuXI)[1]
+0.005115089514066497
+>>> cm2.distance(metric=DistanceType.BaulieuXI)[1]
+0.008951406649616368
+>>> cm1.distance(metric=DistanceType.BaulieuXII)[1]
+0.8
+>>> cm2.distance(metric=DistanceType.BaulieuXII)[1]
+0.875
+>>> cm1.distance(metric=DistanceType.BaulieuXIII)[1]
+0.2857142857142857
+>>> cm2.distance(metric=DistanceType.BaulieuXIII)[1]
+0.4117647058823529
+>>> cm1.distance(metric=DistanceType.BaulieuXIV)[1]
+0.75
+>>> cm2.distance(metric=DistanceType.BaulieuXIV)[1]
+0.8333333333333334
+>>> cm1.distance(metric=DistanceType.BaulieuXV)[1]
+0.75
+>>> cm2.distance(metric=DistanceType.BaulieuXV)[1]
+0.8461538461538461
+>>> cm1.distance(metric=DistanceType.BeniniI)[1]
+0.49743589743589745
+>>> cm2.distance(metric=DistanceType.BeniniI)[1]
+0.3953727506426735
+>>> cm1.distance(metric=DistanceType.BeniniII)[1]
+0.49743589743589745
+>>> cm2.distance(metric=DistanceType.BeniniII)[1]
+0.3953727506426735
+>>> cm1.distance(metric=DistanceType.Canberra)[1]
+0.5
+>>> cm2.distance(metric=DistanceType.Canberra)[1]
+0.6363636363636364
+>>> cm1.distance(metric=DistanceType.Clement)[1]
+0.5025379382522239
+>>> cm2.distance(metric=DistanceType.Clement)[1]
+0.33840586363079933
+>>> cm1.distance(metric=DistanceType.ConsonniTodeschiniI)[1]
+0.9992336018090547
+>>> cm2.distance(metric=DistanceType.ConsonniTodeschiniI)[1]
+0.998656222829757
+>>> cm1.distance(metric=DistanceType.ConsonniTodeschiniII)[1]
+0.7585487129939101
+>>> cm2.distance(metric=DistanceType.ConsonniTodeschiniII)[1]
+0.6880377723094788
+>>> cm1.distance(metric=DistanceType.ConsonniTodeschiniIII)[1]
+0.16481614417697044
+>>> cm2.distance(metric=DistanceType.ConsonniTodeschiniIII)[1]
+0.16481614417697044
+>>> cm1.distance(metric=DistanceType.ConsonniTodeschiniIV)[1]
+0.5645750340535797
+>>> cm2.distance(metric=DistanceType.ConsonniTodeschiniIV)[1]
+0.47712125471966244
+>>> cm1.distance(metric=DistanceType.ConsonniTodeschiniV)[1]
+0.48072545510682463
+>>> cm2.distance(metric=DistanceType.ConsonniTodeschiniV)[1]
+0.4003930264973547
+
 """

From 0895f77acfbc6c41f62e8b2f5ccb41babe2b92c0 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Tue, 3 Jan 2023 12:45:51 +0330
Subject: [PATCH 36/47] fix : error_test.py updated

---
 Test/error_test.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Test/error_test.py b/Test/error_test.py
index b57b7fe2..512b5b7e 100644
--- a/Test/error_test.py
+++ b/Test/error_test.py
@@ -53,6 +53,10 @@
 >>> y_actu = [2, 0, 2, 2, 0, 1, 1, 2, 2, 0, 1, 2]
 >>> y_pred = [0, 0, 2, 1, 0, 2, 1, 0, 2, 0, 2, 2]
 >>> cm = ConfusionMatrix(y_actu,y_pred)
+>>> cm.distance(metric = 2)
+Traceback (most recent call last):
+        ...
+pycm.pycm_error.pycmMatrixError: The metric type must be DistanceType
 >>> cm.relabel([1,2,3])
 Traceback (most recent call last):
         ...

From 11f922fed2030855bc40145fa6982125208e1274 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Tue, 3 Jan 2023 12:54:55 +0330
Subject: [PATCH 37/47] fix : function_test.py updated

---
 Test/function_test.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Test/function_test.py b/Test/function_test.py
index 116e9d4f..dd789717 100644
--- a/Test/function_test.py
+++ b/Test/function_test.py
@@ -1,6 +1,7 @@
 # -*- coding: utf-8 -*-
 """
 >>> from pycm import *
+>>> from pycm.pycm_distance import DISTANCE_MAPPER
 >>> import os
 >>> import json
 >>> import numpy as np
@@ -717,4 +718,9 @@
 >>> cm4.to_array()
 array([[3, 1],
        [0, 0]])
+>>> result = []
+>>> for item in DISTANCE_MAPPER.values():
+...     result.append(item(TP=2, TN=2, FP=1, FN="2"))
+>>> all(list(map(lambda x: x=="None", result)))
+True
 """

From 4334a3cf6faa0f07181e60196c0824bb10667db6 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Wed, 4 Jan 2023 14:42:19 +0330
Subject: [PATCH 38/47] doc : Document.ipynb updated

---
 Document/Document.ipynb | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Document/Document.ipynb b/Document/Document.ipynb
index b79cdba0..35376e97 100644
--- a/Document/Document.ipynb
+++ b/Document/Document.ipynb
@@ -71,6 +71,7 @@
     "            <li><a href=\"#To-array\">To Array</a></li>\n",
     "            <li><a href=\"#Combine\">Combine</a></li>\n",
     "            <li><a href=\"#Plot\">Plot</a></li>\n",
+    "            <li><a href=\"#Distance/Similarity\">Distance/Similarity</a></li>\n",
     "            <li><a href=\"#Parameter-recommender\">Parameter Recommender</a></li>\n",
     "            <li><a href=\"#Compare\">Compare</a></li>\n",
     "            <li><a href=\"#ROC-curve\">ROC Curve</a></li>\n",
@@ -2293,6 +2294,30 @@
     "</ul>"
    ]
   },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "### Distance/Similarity"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "- [Jupyter Notebook](https://nbviewer.jupyter.org/github/sepandhaghighi/pycm/blob/master/Document/Distance.ipynb)\n",
+    "- [HTML](http://www.pycm.io/doc/Distance.html)"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "<ul>\n",
+    "    <li><span style=\"color:red;\">Notice </span> :  new in <span style=\"color:red;\">version 3.8</span> </li>\n",
+    "</ul>"
+   ]
+  },
   {
    "cell_type": "markdown",
    "metadata": {},

From 5cb97a5f76c16231430d843679095fdecb80ee9b Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Wed, 4 Jan 2023 14:42:53 +0330
Subject: [PATCH 39/47] fix : autopep8

---
 pycm/pycm_curve.py    | 6 ++++--
 pycm/pycm_distance.py | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/pycm/pycm_curve.py b/pycm/pycm_curve.py
index c714acc4..9a187aa0 100644
--- a/pycm/pycm_curve.py
+++ b/pycm/pycm_curve.py
@@ -93,8 +93,10 @@ def area(self, method="trapezoidal"):
             dx = numpy.diff(x)
             if numpy.any(dx < 0) and numpy.any(dx > 0):
                 sort_indices = numpy.argsort(x, kind="mergesort")
-                self.data[c][self.plot_x_axis] = x = numpy.array(x)[sort_indices].tolist()
-                self.data[c][self.plot_y_axis] = y = numpy.array(y)[sort_indices].tolist()
+                self.data[c][self.plot_x_axis] = x = numpy.array(x)[
+                    sort_indices].tolist()
+                self.data[c][self.plot_y_axis] = y = numpy.array(y)[
+                    sort_indices].tolist()
             if method == "trapezoidal":
                 self.auc[c] = __trapezoidal_numeric_integral__(x, y)
             elif method == "midpoint":
diff --git a/pycm/pycm_distance.py b/pycm/pycm_distance.py
index 906a13f2..19298b1b 100644
--- a/pycm/pycm_distance.py
+++ b/pycm/pycm_distance.py
@@ -710,4 +710,4 @@ def ConsonniTodeschiniV_calc(TP, FP, FN, TN):
     DistanceType.ConsonniTodeschiniIII: ConsonniTodeschiniIII_calc,
     DistanceType.ConsonniTodeschiniIV: ConsonniTodeschiniIV_calc,
     DistanceType.ConsonniTodeschiniV: ConsonniTodeschiniV_calc,
-    }
+}

From 26670e07a0cf8a102ee37a6c665f765f2525efcf Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Wed, 4 Jan 2023 14:48:13 +0330
Subject: [PATCH 40/47] doc : CHANGELOG updated

---
 CHANGELOG.md | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 984c6600..573c5b00 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,39 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
 and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
 
 ## [Unreleased]
+### Added
+- `distance` method
+- 30 new distance/similarity
+	1. AMPLE
+	2. Anderberg's D
+	3. Andres & Marzo's Delta
+	4. Baroni-Urbani & Buser I
+	5. Baroni-Urbani & Buser II
+	6. Batagelj & Bren
+	7. Baulieu I
+	8. Baulieu II
+	9. Baulieu III
+	10. Baulieu IV
+	11. Baulieu V
+	12. Baulieu VI
+	13. Baulieu VII
+	14. Baulieu VIII
+	15. Baulieu IX
+	16. Baulieu X
+	17. Baulieu XI
+	18. Baulieu XII
+	19. Baulieu XIII
+	20. Baulieu XIV
+	21. Baulieu XV
+	22. Benini I
+	23. Benini II
+	24. Canberra
+	25. Clement
+	26. Consonni & Todeschini I
+	27. Consonni & Todeschini II
+	28. Consonni & Todeschini III
+	29. Consonni & Todeschini IV
+	30. Consonni & Todeschini V
 ### Changed
 - `README.md` modified
 - Document modified

From 279aaff941ce9cf06bc059b3cf1601d1bfcf8de0 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Wed, 4 Jan 2023 14:49:44 +0330
Subject: [PATCH 41/47] doc : Document updated

---
 Document/README.md | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/Document/README.md b/Document/README.md
index c91b74b9..d0d9d936 100644
--- a/Document/README.md
+++ b/Document/README.md
@@ -8,7 +8,12 @@
 ## Document	
 
 - [Jupyter Notebook](https://nbviewer.jupyter.org/github/sepandhaghighi/pycm/blob/master/Document/Document.ipynb)
-- [HTML](http://www.pycm.io/doc/)				
+- [HTML](http://www.pycm.io/doc/)	
+
+## Distance
+
+- [Jupyter Notebook](https://nbviewer.jupyter.org/github/sepandhaghighi/pycm/blob/master/Document/Distance.ipynb)
+- [HTML](http://www.pycm.io/doc/Distance.html)				
 
 
 ## Example-1 (Comparison of three different classifiers)	

From c297a6529ff40410a484cf806b6a63c37dd125c0 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Wed, 4 Jan 2023 18:42:12 +0330
Subject: [PATCH 42/47] doc : minor edit in Distance.ipynb titles

---
 Document/Distance.ipynb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Document/Distance.ipynb b/Document/Distance.ipynb
index 066af5d1..d19c7868 100644
--- a/Document/Distance.ipynb
+++ b/Document/Distance.ipynb
@@ -104,7 +104,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "## Anderberg's D."
+    "## Anderberg's D"
    ]
   },
   {

From e2e3b63cd836cf118afed7c1aa62350cd0835cc4 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Wed, 4 Jan 2023 19:39:06 +0330
Subject: [PATCH 43/47] doc : Baulieu IV formula fixed

---
 Document/Distance.ipynb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Document/Distance.ipynb b/Document/Distance.ipynb
index d19c7868..03b5a6c8 100644
--- a/Document/Distance.ipynb
+++ b/Document/Distance.ipynb
@@ -527,7 +527,7 @@
    "cell_type": "markdown",
    "metadata": {},
    "source": [
-    "$$dist_{BaulieuIV} = \\frac{FP+FN-(TP+\\frac{1}{2})\\times(TN+\\frac{1}{2})\\times TN  \\times k}{TN}$$"
+    "$$dist_{BaulieuIV} = \\frac{FP+FN-(TP+\\frac{1}{2})\\times(TN+\\frac{1}{2})\\times TN  \\times k}{POP}$$"
    ]
   },
   {

From 9dc26184ebe639b2ed4700c557ea0304db7d606f Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Wed, 4 Jan 2023 19:40:42 +0330
Subject: [PATCH 44/47] doc : Distance notebook added to notebook_check.py

---
 Otherfiles/notebook_check.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Otherfiles/notebook_check.py b/Otherfiles/notebook_check.py
index 8545f8ab..a8f8ae75 100644
--- a/Otherfiles/notebook_check.py
+++ b/Otherfiles/notebook_check.py
@@ -7,6 +7,7 @@
 
 NOTEBOOKS_LIST = [
     "Document",
+    "Distance",
     "Example1",
     "Example2",
     "Example3",

From 5ee17e556f30a73150ab413b50dc512e58bf509e Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Wed, 4 Jan 2023 19:42:27 +0330
Subject: [PATCH 45/47] doc : distance method docstring updated

---
 pycm/pycm_obj.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pycm/pycm_obj.py b/pycm/pycm_obj.py
index 07d2b5a0..bbf6fe6b 100644
--- a/pycm/pycm_obj.py
+++ b/pycm/pycm_obj.py
@@ -598,7 +598,7 @@ def distance(self, metric):
 
         :param metric: metric
         :type metric: DistanceType
-        :return: result as float
+        :return: result as dict
         """
         distance_dict = {}
         if not isinstance(metric, DistanceType):

From 87d2c825554f236e96bc5c5362747a3ad4853863 Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Wed, 4 Jan 2023 19:45:44 +0330
Subject: [PATCH 46/47] doc : verified_test.py links updated

---
 Test/verified_test.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Test/verified_test.py b/Test/verified_test.py
index 17ad3c10..ffb959d9 100644
--- a/Test/verified_test.py
+++ b/Test/verified_test.py
@@ -427,8 +427,8 @@
 True
 >>> abs(crv.area(method="midpoint")[2] - 0.2916) < 0.001
 True
->>> cm1 = ConfusionMatrix(matrix = {1:{1:2,0:2},0:{0:778,1:2}})  # Verified Case -- (https://bit.ly/3BVdNBp)
->>> cm2 = ConfusionMatrix(matrix = {1:{1:2,0:3},0:{0:775,1:4}})  # Verified Case -- (https://bit.ly/3BVdNBp)
+>>> cm1 = ConfusionMatrix(matrix = {1:{1:2,0:2},0:{0:778,1:2}})  # Verified Case -- (https://bit.ly/3vVMWRT)
+>>> cm2 = ConfusionMatrix(matrix = {1:{1:2,0:3},0:{0:775,1:4}})  # Verified Case -- (https://bit.ly/3vVMWRT)
 >>> cm1.distance(metric=DistanceType.AMPLE)[1]
 0.49743589743589745
 >>> cm2.distance(metric=DistanceType.AMPLE)[1]

From d97768a38e85497bbaa2056e9a351b85f090f3de Mon Sep 17 00:00:00 2001
From: sepandhaghighi <sepand.haghighi@yahoo.com>
Date: Wed, 4 Jan 2023 22:56:07 +0330
Subject: [PATCH 47/47] doc : minor edit in Distance.ipynb style

---
 Document/Distance.ipynb | 62 ++++++++++++++++++++---------------------
 1 file changed, 31 insertions(+), 31 deletions(-)

diff --git a/Document/Distance.ipynb b/Document/Distance.ipynb
index 03b5a6c8..2cd9f832 100644
--- a/Document/Distance.ipynb
+++ b/Document/Distance.ipynb
@@ -36,7 +36,7 @@
    "metadata": {},
    "outputs": [],
    "source": [
-    "cm = ConfusionMatrix(matrix = {0: {0: 3, 1: 0, 2: 0}, 1: {0: 0, 1: 1, 2: 2}, 2: {0: 2, 1: 1, 2: 3}})"
+    "cm = ConfusionMatrix(matrix={0: {0: 3, 1: 0, 2: 0}, 1: {0: 0, 1: 1, 2: 2}, 2: {0: 2, 1: 1, 2: 3}})"
    ]
   },
   {
@@ -88,7 +88,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.AMPLE)"
+    "cm.distance(metric=DistanceType.AMPLE)"
    ]
   },
   {
@@ -140,7 +140,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.Anderberg)"
+    "cm.distance(metric=DistanceType.Anderberg)"
    ]
   },
   {
@@ -191,7 +191,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.AndresMarzoDelta)"
+    "cm.distance(metric=DistanceType.AndresMarzoDelta)"
    ]
   },
   {
@@ -242,7 +242,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaroniUrbaniBuserI)"
+    "cm.distance(metric=DistanceType.BaroniUrbaniBuserI)"
    ]
   },
   {
@@ -293,7 +293,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaroniUrbaniBuserII)"
+    "cm.distance(metric=DistanceType.BaroniUrbaniBuserII)"
    ]
   },
   {
@@ -344,7 +344,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BatageljBren)"
+    "cm.distance(metric=DistanceType.BatageljBren)"
    ]
   },
   {
@@ -395,7 +395,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuI)"
+    "cm.distance(metric=DistanceType.BaulieuI)"
    ]
   },
   {
@@ -446,7 +446,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuII)"
+    "cm.distance(metric=DistanceType.BaulieuII)"
    ]
   },
   {
@@ -497,7 +497,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuIII)"
+    "cm.distance(metric=DistanceType.BaulieuIII)"
    ]
   },
   {
@@ -547,7 +547,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuIV)"
+    "cm.distance(metric=DistanceType.BaulieuIV)"
    ]
   },
   {
@@ -604,7 +604,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuV)"
+    "cm.distance(metric=DistanceType.BaulieuV)"
    ]
   },
   {
@@ -654,7 +654,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuVI)"
+    "cm.distance(metric=DistanceType.BaulieuVI)"
    ]
   },
   {
@@ -704,7 +704,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuVII)"
+    "cm.distance(metric=DistanceType.BaulieuVII)"
    ]
   },
   {
@@ -754,7 +754,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuVIII)"
+    "cm.distance(metric=DistanceType.BaulieuVIII)"
    ]
   },
   {
@@ -804,7 +804,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuIX)"
+    "cm.distance(metric=DistanceType.BaulieuIX)"
    ]
   },
   {
@@ -854,7 +854,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuX)"
+    "cm.distance(metric=DistanceType.BaulieuX)"
    ]
   },
   {
@@ -904,7 +904,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuXI)"
+    "cm.distance(metric=DistanceType.BaulieuXI)"
    ]
   },
   {
@@ -954,7 +954,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuXII)"
+    "cm.distance(metric=DistanceType.BaulieuXII)"
    ]
   },
   {
@@ -1004,7 +1004,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuXIII)"
+    "cm.distance(metric=DistanceType.BaulieuXIII)"
    ]
   },
   {
@@ -1054,7 +1054,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuXIV)"
+    "cm.distance(metric=DistanceType.BaulieuXIV)"
    ]
   },
   {
@@ -1104,7 +1104,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BaulieuXV)"
+    "cm.distance(metric=DistanceType.BaulieuXV)"
    ]
   },
   {
@@ -1154,7 +1154,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BeniniI)"
+    "cm.distance(metric=DistanceType.BeniniI)"
    ]
   },
   {
@@ -1204,7 +1204,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.BeniniII)"
+    "cm.distance(metric=DistanceType.BeniniII)"
    ]
   },
   {
@@ -1255,7 +1255,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.Canberra)"
+    "cm.distance(metric=DistanceType.Canberra)"
    ]
   },
   {
@@ -1307,7 +1307,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.Clement)"
+    "cm.distance(metric=DistanceType.Clement)"
    ]
   },
   {
@@ -1358,7 +1358,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.ConsonniTodeschiniI)"
+    "cm.distance(metric=DistanceType.ConsonniTodeschiniI)"
    ]
   },
   {
@@ -1409,7 +1409,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.ConsonniTodeschiniII)"
+    "cm.distance(metric=DistanceType.ConsonniTodeschiniII)"
    ]
   },
   {
@@ -1460,7 +1460,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.ConsonniTodeschiniIII)"
+    "cm.distance(metric=DistanceType.ConsonniTodeschiniIII)"
    ]
   },
   {
@@ -1511,7 +1511,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.ConsonniTodeschiniIV)"
+    "cm.distance(metric=DistanceType.ConsonniTodeschiniIV)"
    ]
   },
   {
@@ -1562,7 +1562,7 @@
     }
    ],
    "source": [
-    "cm.distance(metric = DistanceType.ConsonniTodeschiniV)"
+    "cm.distance(metric=DistanceType.ConsonniTodeschiniV)"
    ]
   },
   {