mobgap.initial_contacts.evaluation.icd_per_datapoint_score#

mobgap.initial_contacts.evaluation.icd_per_datapoint_score(
pipeline: IcdEmulationPipeline,
datapoint: BaseGaitDatasetWithReference,
) dict[source]#

Evaluate the performance of an ICD algorithm on a single datapoint.

Warning

This function is not meant to be called directly, but as a scoring function in a tpcp.validate.Scorer. If you are writing custom scoring functions, you can use this function as a template or wrap it in a new function.

This function is used to evaluate the performance of an ICD algorithm on a single datapoint. It calculates the performance metrics based on the detected initial contacts and the reference initial contacts.

The following performance metrics are calculated:

  • all outputs of calculate_matched_icd_performance_metrics (will be averaged over all datapoints)

  • matches: The matched initial contacts calculated by categorize_ic_list (return as no_agg)

  • detected: The detected initial contacts (return as no_agg)

  • reference: The reference initial contacts (return as no_agg)

  • sampling_rate_hz: The sampling rate of the data (return as no_agg)

Parameters:
pipeline

An instance of ICD emulation pipeline that wraps the algorithm that should be evaluated.

datapoint

The datapoint to be evaluated.

Returns:
dict

A dictionary containing the performance metrics. Note, that some results are wrapped in a no_agg object or other aggregators. The results of this function are not expected to be parsed manually, but rather the function is expected to be used in the context of the validate/cross_validate functions or similar as scorer. This functions will aggregate the results and provide a summary of the performance metrics.