From a92129d3a5e31d2f6db654db6915f24c85578335 Mon Sep 17 00:00:00 2001 From: kasun Date: Thu, 14 Dec 2023 19:16:46 +0000 Subject: [PATCH] minor fixes --- src/triage/component/postmodeling/report_generator.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/triage/component/postmodeling/report_generator.py b/src/triage/component/postmodeling/report_generator.py index 31ae7cb4b..ea8b3ad1b 100644 --- a/src/triage/component/postmodeling/report_generator.py +++ b/src/triage/component/postmodeling/report_generator.py @@ -479,11 +479,12 @@ def _pairwise_feature_importance_comparison_single_split(self, train_end_time, n results = dict() for m in metrics: - results[m] = pd.DataFrame(index=model_group_ids, columns=model_group_ids) + results[m] = pd.DataFrame(index=sorted(model_group_ids), columns=sorted(model_group_ids)) # filling the diagonal with 1 results[m].values[[np.arange(results[m].shape[0])]*2] = 1 for model_group_pair in pairs: + model_group_pair = sorted(model_group_pair) logging.info(f'Comparing {model_group_pair[0]} and {model_group_pair[1]}') df1 = feature_lists[model_group_pair[0]] @@ -561,7 +562,7 @@ def _pairwise_list_comparison_single_fold(self, threshold_type, threshold, train # Initializing three data frames to hold pairwise metrics for m in metrics: - results[m] = pd.DataFrame(index=self.model_groups, columns=self.model_groups) + results[m] = pd.DataFrame(index=sorted(self.model_groups), columns=sorted(self.model_groups)) for model_group_pair in pairs: