CustomMetric

Trait CustomMetric 

Source
pub trait CustomMetric: Send + Sync {
    // Required methods
    fn name(&self) -> &str;
    fn compute(
        &self,
        parameters: &HashMap<String, Float>,
        objective_value: Float,
        history: &OptimizationHistory,
    ) -> Result<Float, MetricError>;
    fn higher_is_better(&self) -> bool;
}
Expand description

Custom metric trait

Required Methods§

Source

fn name(&self) -> &str

Metric name

Source

fn compute( &self, parameters: &HashMap<String, Float>, objective_value: Float, history: &OptimizationHistory, ) -> Result<Float, MetricError>

Compute metric value

Source

fn higher_is_better(&self) -> bool

Whether higher is better

Implementors§