traccuracy.metrics._base

Module Contents

Classes

Metric

The base class for Metrics

Attributes

MATCHING_TYPES

traccuracy.metrics._base.MATCHING_TYPES = ['one-to-one', 'one-to-many', 'many-to-one', 'many-to-many']
class traccuracy.metrics._base.Metric(valid_matches: list, zero_division: float = np.nan)[source]

The base class for Metrics

Data should be passed directly into the compute method Kwargs should be specified in the constructor

property info: dict[str, Any]

Dictionary with Metric name and any parameters

compute(matched: traccuracy.matchers._matched.Matched, override_matcher: bool = False, relax_skips_gt: bool = False, relax_skips_pred: bool = False) traccuracy.metrics._results.Results[source]

The compute methods of Metric objects return a Results object populated with results and associated metadata

Parameters:
  • matched (traccuracy.matchers.Matched) – Matched data object to compute metrics on

  • override_matcher (bool) – If True, the metric will not validate the matcher type

  • relax_skips_gt (bool) – If True, the metric will check if skips in the ground truth graph have an equivalent multi-edge path in predicted graph

  • relax_skips_pred (bool) – If True, the metric will check if skips in the predicted graph have an equivalent multi-edge path in ground truth graph

Returns:

Object containing metric results

and associated pipeline metadata

Return type:

traccuracy.metrics._results.Results