reductionml_core/metrics/
metric_registry.rs

1use crate::metrics::{ips, parsed_features};
2
3use super::{example_number, mean_squared_error, Metric};
4
5pub fn get_metric(name: &str) -> Option<Box<dyn Metric>> {
6    match name {
7        "mse" => Some(Box::new(mean_squared_error::MeanSquaredErrorMetric::new())),
8        "ips" => Some(Box::new(ips::IpsMetric::new())),
9        "parsed_features" => Some(Box::new(parsed_features::ParsedFeaturesMetric::new())),
10        "example_number" => Some(Box::new(example_number::ExampleNumberMetric::new())),
11        _ => None,
12    }
13}