Metric Generators

class stonesoup.metricgenerator.base.MetricGenerator[source]

Bases: stonesoup.base.Base

Metric Generator base class

Generates Metric objects used to asses the performance of a tracker using data held in a MetricManager object

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 Metric objects

class stonesoup.metricgenerator.base.MetricManager[source]

Bases: stonesoup.base.Base

Metric Manager base class

Holds the data and manages the production of Metric objects through a MetricGenerator

class stonesoup.metricgenerator.base.MetricTableGenerator[source]

Bases: stonesoup.metricgenerator.base.MetricGenerator

Metric 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

abstract compute_metric(**kwargs)[source]

Generate table

:param : :type : set of :class: ~.Metric objects

Return type

matplotlib.Table object

class stonesoup.metricgenerator.base.PlotGenerator[source]

Bases: stonesoup.metricgenerator.base.MetricGenerator

PlotGenerator base class

PlotGenerators generate metrics that are visualisations. Return PlottingMetric objects.

abstract compute_metric(**kwargs)[source]

Generate table

:param : :type : set of :class: ~.Metric objects

Return type

matplotlib.Table object

Metric Managers

class stonesoup.metricgenerator.manager.SimpleManager(generators: Sequence[MetricGenerator] = None, associator: Associator = None)[source]

SimpleManager class for metric management

Simple MetricManager for the generation of metrics on multiple Track, Detection and GroundTruthPath objects.

Parameters
  • generators (Sequence[MetricGenerator], optional) – List of generators to use

  • associator (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 AssociationSet internally.

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