Distances¶
All the functions here are functions to find the distance between two pieces of data based on contingency table.
Row 2 |
|||
Row 1 |
1 |
0 |
|
1 |
a |
b |
|
0 |
c |
d |
Each function has the same parameters and return values:
- Parameters
- aint
Count of same 1 numbers.
- bint
The sum of 1 in row 1 and 0 in row 2.
- cint
Sum 1 in row 2 and 0 in row 1.
- dint
Count of same 0 numbers.
- nint
Sum of all the numbers.
- Returns
- float
The similarity value between two pieces of data.
- besimilarity.distance.bray_curtis(a, b, c, d, n)[source]¶
Bray-Curtis distance from contingency table.
- besimilarity.distance.get_all_functions_name()[source]¶
Get all the functions in the module.
- Returns
List of functions object.
- Return type
list
- besimilarity.distance.get_function(name)[source]¶
Get function by name.
- Parameters
name (str) – Name of the function.
- Returns
Function object.
- Return type
function
- besimilarity.distance.lance_williams(a, b, c, d, n)[source]¶
Lance Williams distance from contingency table.
- besimilarity.distance.mean_manhattan(a, b, c, d, n)[source]¶
Mean Manhattan distance from contingency table.
- besimilarity.distance.pattern_difference(a, b, c, d, n)[source]¶
Pattern difference from contingency table.
- besimilarity.distance.shape_difference(a, b, c, d, n)[source]¶
Shape difference from contingency table.
- besimilarity.distance.size_difference(a, b, c, d, n)[source]¶
Size difference from contingency table.