pub trait SimilarityCombiner {
    // Required method
    fn combine(&self, m: &Matrix<'_, f32>) -> f32;

    // Provided methods
    fn calculate(&self, m: &Matrix<'_, f32>) -> f32 { ... }
    fn row_maxes(&self, m: &Matrix<'_, f32>) -> Vec<f32> { ... }
    fn col_maxes(&self, m: &Matrix<'_, f32>) -> Vec<f32> { ... }
    fn dim_f32(&self, m: &Matrix<'_, f32>) -> (f32, f32) { ... }
}
Expand description

This trait is needed to calculate the similarity between HpoSets.

For similarity calculation between HpoSets the similarity scores must be combined to derive a single f32 value from a matrix of term - term similarities

hpo provides some default implementations of SimilarityCombiner: StandardCombiner

Required Methods§

source

fn combine(&self, m: &Matrix<'_, f32>) -> f32

This method implements the actual logic to calculate a single similarity score from a Matrix of term - term similarity scores.

Provided Methods§

source

fn calculate(&self, m: &Matrix<'_, f32>) -> f32

this method is called by GroupSimilarity to combine individual term - term similarity scores into a single score for the group - group similarity

source

fn row_maxes(&self, m: &Matrix<'_, f32>) -> Vec<f32>

Returns the maximum values of each row

source

fn col_maxes(&self, m: &Matrix<'_, f32>) -> Vec<f32>

Returns the maximum values of each column

source

fn dim_f32(&self, m: &Matrix<'_, f32>) -> (f32, f32)

Returns the dimenension of the Matrix, (rows, columns)

Implementors§