matching

Function matching 

Source
pub fn matching(x: &ArrayView1<'_, f64>, y: &ArrayView1<'_, f64>) -> f64
Expand description

Computes the Matching similarity between two binary vectors.

The Matching similarity is the proportion of positions where the two binary vectors differ in their values. The vectors are treated as binary, where non-zero values are considered True and zero values are considered False.

The formula is:

..math:: M(x, y) = \frac{|{x_i \neq y_i}|}{n}

where n is the number of elements in the vectors.

§Arguments

  • x - A 1D array (view) of values representing the first binary vector.
  • y - A 1D array (view) of values representing the second binary vector.

§Returns

A f64 value representing the Matching similarity.