fl4health.utils.metric_aggregation module¶
- evaluate_metrics_aggregation_fn(all_client_metrics)[source]¶
Function for evaluate that computes a weighted aggregation of the client metrics and normalizes by the total number of samples.
- fit_metrics_aggregation_fn(all_client_metrics)[source]¶
Function for fit that computes a weighted aggregation of the client metrics and normalizes by the total number of samples.
- metric_aggregation(all_client_metrics)[source]¶
Function that computes a weighted aggregation of metrics normalized by the total number of samples.
- normalize_metrics(total_examples, aggregated_metrics)[source]¶
Function that normalizes metrics by provided sample count.
- Parameters:
total_examples (int) – The total number of samples across all client datasets.
aggregated_metrics (Metrics) – Metrics that have been aggregated across clients.
- Returns:
The metrics normalized by total_examples.
- Return type:
Metrics
- uniform_evaluate_metrics_aggregation_fn(all_client_metrics)[source]¶
Function for evaluate that computes aggregation of the client metrics and normalizes by the number of clients that contributed to the metric.
- uniform_metric_aggregation(all_client_metrics)[source]¶
Function that aggregates client metrics and divides by the number of clients that contributed to metric.