mobgap.gait_sequences.evaluation.gsd_final_agg#
- mobgap.gait_sequences.evaluation.gsd_final_agg(
- agg_results: dict[str, float],
- single_results: dict[str, list],
- pipeline: GsdEmulationPipeline,
- dataset: BaseGaitDatasetWithReference,
Aggregate the performance metrics of a GSD algorithm over multiple datapoints.
Warning
This function is not meant to be called directly, but as
final_aggregatorin atpcp.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 aggregates the performance metrics as follows:
All raw outputs (
detected,reference,sampling_rate_hz) are concatenated to a single dataframe, to make it easier to work with and are returned as part of the single results.We recalculate all performance metrics from
calculate_unmatched_gsd_performance_metricsandcalculate_matched_gsd_performance_metricson the combined data. The results are prefixed withcombined__. Compared to the per-datapoint results (which are calculated, as errors per recording -> average over all recordings), these metrics are calculated as combining all GSDs from all recordings and then calculating the performance metrics. Effectively, this means, that in theper_datapointversion, each recording is weighted equally, while in thecombinedversion, each GS is weighted equally.
- Parameters:
- agg_results
The aggregated results from all datapoints (see
Scorer).- single_results
The per-datapoint results (see
Scorer).- pipeline
The pipline that was passed to the scorer. This is ignored in this function, but might be useful in custom final aggregators.
- dataset
The dataset that was passed to the scorer.
- Returns:
- final_agg_results
The final aggregated results.
- final_single_results
The per-datapoint results, that are not aggregated.