Skip to content

Commit b26b850

Browse files
committed
an issue of the init method regarding self.model clarified, progress bar support of the main algorithm added
Signed-off-by: Kalousios <chrysostomos.kalousios@fujitsu.com>
1 parent 86c141d commit b26b850

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

aif360/algorithms/intersectional_fairness.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from aif360.algorithms.isf_helpers.postprocessing.equalized_odds_postprocessing import EqualizedOddsPostProcessing
3939

4040
from logging import getLogger, StreamHandler, ERROR, Formatter
41+
from tqdm import tqdm
4142

4243
class IntersectionalFairness():
4344
"""
@@ -345,9 +346,10 @@ def _mitigate_each_pair(self, dataset_actual, enable_fit=False, dataset_predicte
345346
for group2_idx in range(group1_idx + 1, len(self.group_protected_attrs)):
346347
id_touples.append((group1_idx, group2_idx, enable_fit))
347348

348-
with concurrent.futures.ProcessPoolExecutor(max_workers=self.MAX_WORKERS) as excuter:
349-
mitigation_results = list(excuter.map(self._worker, id_touples))
350-
for r in mitigation_results:
349+
with concurrent.futures.ProcessPoolExecutor(max_workers=self.MAX_WORKERS) as executor:
350+
futures = [executor.submit(self._worker, id_tuple) for id_tuple in id_touples]
351+
for future in tqdm(concurrent.futures.as_completed(futures), total=len(id_touples)):
352+
r = future.result()
351353
ds_pair_transf_list.append(r[0])
352354
self.models[r[2]] = r[1]
353355

aif360/algorithms/isf_helpers/inprocessing/inprocessing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ class InProcessing(metaclass=ABCMeta):
2424
"""
2525
def __init__(self):
2626
super().__init__()
27-
self.model = None
27+
#the following line is need if we decide to expand support for more inprocessing algorithms besides adversarial debiasing
28+
#self.model = None
2829

2930
@abstractmethod
3031
def fit(self, ds_train):

0 commit comments

Comments
 (0)