nirs4all.visualization.chart_utils.aggregator module

DataAggregator - Aggregate scores using different strategies.

class nirs4all.visualization.chart_utils.aggregator.DataAggregator[source]

Bases: object

Aggregate scores using different strategies.

Supports multiple aggregation methods with proper handling of ranking information (when display and rank metrics differ).

static aggregate(scores: List, method: str, higher_better: bool) float[source]

Aggregate scores using specified method.

Parameters:
  • scores – List of scores (can be floats or tuples of (display_score, rank_score)).

  • method – Aggregation method (‘best’, ‘worst’, ‘mean’, ‘median’).

  • higher_better – Whether higher values are better.

Returns:

Aggregated score value.