bulk_braun_blanquet_binary_distance#
- skfp.distances.bulk_braun_blanquet_binary_distance(X: ndarray, Y: ndarray | None = None) ndarray #
Bulk Braun-Blanquet distance for vectors of binary values.
Computes the pairwise Braun-Blanquet distance between binary matrices. If one array is passed, distances are computed between its rows. For two arrays, distances are between their respective rows, with i-th row and j-th column in output corresponding to i-th row from first array and j-th row from second array.
See also
braun_blanquet_binary_distance()
.- Parameters:
X (ndarray) – First binary input array, of shape
Y (ndarray, default=None) – Second binary input array, of shape
. If not passed, distances are computed between rows of X.
- Returns:
distances – Array with pairwise Braun-Blanquet distance values. Shape is
if two arrays are passed, or otherwise.- Return type:
ndarray
See also
braun_blanquet_binary_distance()
Braun-Blanquet distance function for two vectors
Examples
>>> from skfp.distances import bulk_braun_blanquet_binary_distance >>> import numpy as np >>> X = np.array([[1, 0, 1], [1, 0, 1]]) >>> Y = np.array([[1, 0, 1], [1, 0, 1]]) >>> dist = bulk_braun_blanquet_binary_distance(X, Y) >>> dist array([[0., 0.], [0., 0.]])
>>> X = np.array([[1, 0, 1], [1, 0, 1]]) >>> dist = bulk_braun_blanquet_binary_distance(X) >>> dist array([[0., 0.], [0., 0.]])