From 8f35298ba160a6c7d83c8ffa9323c08e4bedcd8f Mon Sep 17 00:00:00 2001 From: Yu Wu Date: Wed, 22 Nov 2023 16:13:28 +0800 Subject: [PATCH] add warning if some columns missing mode Signed-off-by: Yu Wu --- python/federatedml/statistic/statics.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/federatedml/statistic/statics.py b/python/federatedml/statistic/statics.py index fab4d4efcd..967604767a 100755 --- a/python/federatedml/statistic/statics.py +++ b/python/federatedml/statistic/statics.py @@ -587,6 +587,9 @@ def merge_count_dict(x, y): return x data_mode_summary = data_reduce_by_col_val.mapPartitions(func).reduce(merge_count_dict) + diff = set(data_overview.get_header(data)).difference(set(data_mode_summary.keys())) + if diff: + LOGGER.warning(f"Following columns do not have mode: {diff}.") return data_mode_summary def get_mode(self, col=None, multi_mode='random'):