nvflare.app_common.statistics.numeric_stats module

accumulate_hists(metrics: Dict[str, Dict[str, Histogram]], global_hists: Dict[str, Dict[str, Histogram]]) Dict[str, Dict[str, Histogram]][source]
accumulate_metrics(metrics: dict, global_metrics: dict) dict[source]
bins_to_dict(bins: List[Bin]) Dict[BinRange, float][source]
filter_numeric_features(ds_features: Dict[str, List[Feature]]) Dict[str, List[Feature]][source]
get_global_feature_data_types(client_feature_dts: Dict[str, Dict[str, List[Feature]]]) Dict[str, Dict[str, DataType]][source]
get_global_stats(global_metrics: dict, client_metrics: dict, metric_task: str) dict[source]
get_means(sums: dict, counts: dict) dict[source]
get_min_or_max_values(metrics: dict, global_metrics: dict, fn2) dict[source]

Use 2 argument function to calculate fn2(global, client), for example, min or max.


The global min/max values are min/max of all clients and all datasets.

  • metrics – client’s metric

  • global_metrics – global metrics

  • fn2 – two-argument function such as min or max

Returns: Dict[dataset, Dict[feature, int]]