ScoringFunction

Trait ScoringFunction 

Source
pub trait ScoringFunction: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn score(
        &self,
        feature: ArrayView1<'_, f64>,
        target: ArrayView1<'_, f64>,
    ) -> Result<f64>;
    fn clone_scoring(&self) -> Box<dyn ScoringFunction>;

    // Provided method
    fn score_features(
        &self,
        X: ArrayView2<'_, f64>,
        y: ArrayView1<'_, f64>,
    ) -> Result<Array1<f64>> { ... }
}
Expand description

Trait for custom scoring functions

Required Methods§

Source

fn name(&self) -> &str

Get the scoring function name

Source

fn score( &self, feature: ArrayView1<'_, f64>, target: ArrayView1<'_, f64>, ) -> Result<f64>

Compute score for a single feature

Source

fn clone_scoring(&self) -> Box<dyn ScoringFunction>

Clone the scoring function

Provided Methods§

Source

fn score_features( &self, X: ArrayView2<'_, f64>, y: ArrayView1<'_, f64>, ) -> Result<Array1<f64>>

Compute scores for all features in parallel

Implementors§