Metric Generators¶
-
class
stonesoup.metricgenerator.base.MetricGenerator[source]¶ Bases:
stonesoup.base.BaseMetric Generator base class
Generates
Metricobjects used to asses the performance of a tracker using data held in aMetricManagerobject-
abstract
compute_metric(manager, **kwargs)[source]¶ Compute metric
- Parameters
manager (MetricManager) – containing the data to be used to create the metric(s)
- Returns
Generated metrics
- Return type
list of
Metricobjects
-
abstract
-
class
stonesoup.metricgenerator.base.MetricManager[source]¶ Bases:
stonesoup.base.BaseMetric Manager base class
Holds the data and manages the production of
Metricobjects through aMetricGenerator
-
class
stonesoup.metricgenerator.base.MetricTableGenerator[source]¶ Bases:
stonesoup.metricgenerator.base.MetricGeneratorMetric Table base class
Takes a set of :class: ~.Metric objects and outputs a table of the values next to a description and target for each metric
-
class
stonesoup.metricgenerator.base.PlotGenerator[source]¶ Bases:
stonesoup.metricgenerator.base.MetricGeneratorPlotGenerator base class
PlotGenerators generate metrics that are visualisations. Return
PlottingMetricobjects.
Metric Managers¶
-
class
stonesoup.metricgenerator.manager.SimpleManager(generators: Sequence[MetricGenerator] = None, associator: Associator = None)[source]¶ SimpleManager class for metric management
Simple
MetricManagerfor the generation of metrics on multipleTrack,DetectionandGroundTruthPathobjects.- Parameters
generators (
Sequence[MetricGenerator], optional) – List of generators to useassociator (
Associator, optional) – Associator to combine tracks and truth
-
generators: Sequence[stonesoup.metricgenerator.base.MetricGenerator]¶ List of generators to use
-
associator: stonesoup.dataassociator.base.Associator¶ Associator to combine tracks and truth
-
add_data(groundtruth_paths: Optional[Iterable[Union[GroundTruthPath, Platform]]] = None, tracks: Optional[Iterable[Track]] = None, detections: Optional[Iterable[Detection]] = None, overwrite=True)[source]¶ Adds data to the metric generator
- Parameters
groundtruth_paths (list or set of
GroundTruthPath) – Ground truth paths to be added to the manager.tracks (list or set of
Track) – Tracks objects to be added to the manager.detections (list or set of
Detection) – Detections to be added to the manager.overwrite (bool) – declaring whether pre-existing data will be overwritten. Note that overwriting one field (e.g. tracks) does not affect the others
-
associate_tracks()[source]¶ Associate tracks to truth using the associator
The resultant
AssociationSetinternally.
-
generate_metrics()[source]¶ Generate metrics using the generators and data that has been added
- Returns
Metrics generated
- Return type
set of
Metric
-
list_timestamps()[source]¶ List all the timestamps used in the tracks and truth, in order
- Returns
unique timestamps present in the internal tracks and truths.
- Return type
list of
datetime.datetime