pub trait StreamingMetric<T> {
type State;
// Required methods
fn init_state(&self) -> Self::State;
fn update_state(
&self,
state: &mut Self::State,
batch_true: &[T],
batch_pred: &[T],
) -> Result<()>;
fn finalize(&self, state: &Self::State) -> Result<f64>;
}Expand description
Trait for streaming computation of metrics
This trait allows metrics to be computed incrementally without loading the entire dataset into memory at once.
Required Associated Types§
Required Methods§
Sourcefn init_state(&self) -> Self::State
fn init_state(&self) -> Self::State
Initialize the state