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§
Sourcefn score(
&self,
feature: ArrayView1<'_, f64>,
target: ArrayView1<'_, f64>,
) -> Result<f64>
fn score( &self, feature: ArrayView1<'_, f64>, target: ArrayView1<'_, f64>, ) -> Result<f64>
Compute score for a single feature
Sourcefn clone_scoring(&self) -> Box<dyn ScoringFunction>
fn clone_scoring(&self) -> Box<dyn ScoringFunction>
Clone the scoring function
Provided Methods§
Sourcefn score_features(
&self,
X: ArrayView2<'_, f64>,
y: ArrayView1<'_, f64>,
) -> Result<Array1<f64>>
fn score_features( &self, X: ArrayView2<'_, f64>, y: ArrayView1<'_, f64>, ) -> Result<Array1<f64>>
Compute scores for all features in parallel