Skip to main content

Scorer

Trait Scorer 

Source
pub trait Scorer: Send + Sync {
    // Required methods
    fn score(
        &self,
        vector: &ComparisonVector,
        params: &ModelParams,
    ) -> ScoredPair;
    fn estimate_params(
        &self,
        batch: &ComparisonBatch,
        init: Option<ModelParams>,
        max_iter: usize,
    ) -> Result<ModelParams>;

    // Provided method
    fn score_batch(
        &self,
        batch: &ComparisonBatch,
        params: &ModelParams,
    ) -> Vec<ScoredPair> { ... }
}

Required Methods§

Source

fn score(&self, vector: &ComparisonVector, params: &ModelParams) -> ScoredPair

Score a single pair, always CPU, cheap dot product.

Source

fn estimate_params( &self, batch: &ComparisonBatch, init: Option<ModelParams>, max_iter: usize, ) -> Result<ModelParams>

Provided Methods§

Source

fn score_batch( &self, batch: &ComparisonBatch, params: &ModelParams, ) -> Vec<ScoredPair>

Score a batch using the field-major ComparisonBatch.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§