From 8d87613e0e88d7696f5802eac13d8d14ed0e14f3 Mon Sep 17 00:00:00 2001 From: Chris Russell Date: Tue, 26 Nov 2024 14:25:41 +0000 Subject: [PATCH] adjusting interface of evaluate fairness --- src/oxonfair/learners/fair.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/oxonfair/learners/fair.py b/src/oxonfair/learners/fair.py index 342435e..605ef34 100644 --- a/src/oxonfair/learners/fair.py +++ b/src/oxonfair/learners/fair.py @@ -720,6 +720,9 @@ def evaluate_fairness(self, data=None, groups=None, factor=None, *, collect = pd.concat([collect, new_pd], axis='columns') collect.columns = ['original', 'updated'] + else: + collect = pd.concat([collect,], axis='columns') + collect.columns = ['original'] return collect @@ -822,7 +825,9 @@ def evaluate_groups(self, data=None, groups=None, metrics=None, fact=None, *, verbose=verbose) out = updated - if return_original: + if self.frontier is None: + out = pd.concat([updated, ], keys=['original', ]) + elif return_original: out = pd.concat([original, updated], keys=['original', 'updated']) return out