dctools.metrics.evaluator.compute_metric

dctools.metrics.evaluator.compute_metric(entry, pred_source_config, ref_source_config, model, list_metrics, pred_transform, ref_transform, argo_index=None, reduce_precision=False, results_dir=None, surface_only=False)

Compute metrics for a single prediction-reference pair entry.

Parameters:
  • entry (Dict[str, Any]) – Dictionary containing data and metadata for the evaluation.

  • pred_source_config (Namespace) – Configuration for the prediction source.

  • ref_source_config (Namespace) – Configuration for the reference source.

  • model (str) – Name of the model being evaluated.

  • list_metrics (List[MetricComputer]) – List of metric computers to apply.

  • pred_transform (Callable) – Tranformation function for prediction data.

  • ref_transform (Callable) – Transformation function for reference data.

  • argo_index (Optional[Any], optional) – Index for Argo data, if applicable. Defaults to None.

  • reduce_precision (bool, optional) – Whether to reduce floating point precision to float32. Defaults to False.

  • results_dir (str | None)

  • surface_only (bool)

Returns:

Dictionary containing the evaluation results.

Return type:

Dict[str, Any]