pub trait Metric {
// Required methods
fn compute(
&self,
predictions: &ArrayView<'_, f64, Ix2>,
targets: &ArrayView<'_, f64, Ix2>,
) -> TrainResult<f64>;
fn name(&self) -> &str;
// Provided method
fn reset(&mut self) { ... }
}Expand description
Trait for metrics.