getValue<T extends EvaluationMetric> method
Returns the metric named metricName cast to T.
Throws StateError if not found or wrong type.
Implementation
T getValue<T extends EvaluationMetric>(String metricName) {
final m = metrics[metricName];
if (m is T) return m;
throw StateError(
"Metric '$metricName' of type $T was not found in the result.");
}