Skip to content

Commit

Permalink
chore: hatch format
Browse files Browse the repository at this point in the history
  • Loading branch information
crismunoz committed Sep 8, 2024
1 parent d2595aa commit b86c786
Show file tree
Hide file tree
Showing 11 changed files with 9 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import numpy as np
import pandas as pd

from holisticai.bias.mitigation.inprocessing.commons._conventions import (
_ALL,
_EVENT,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
from typing import Any

import pandas as pd
from joblib import Parallel, delayed

from holisticai.bias.mitigation.inprocessing.grid_search._grid_generator import GridGenerator


Expand Down Expand Up @@ -88,7 +86,7 @@ def fit(self, X: Any, y: Any, sensitive_features: Any):
"""
self._load_data(X, y, sensitive_features)
grid = self._generate_grid()

"""
results = Parallel(n_jobs=self.n_jobs, verbose=self.verbose)(
delayed(self.evaluate_candidate)(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
from __future__ import annotations

from typing import Literal, Optional
from typing import Literal

import numpy as np
from sklearn.base import BaseEstimator, clone

from holisticai.bias.mitigation.inprocessing.commons.classification import _constraints as cc
from holisticai.bias.mitigation.inprocessing.commons.regression import _constraints as rc
from holisticai.bias.mitigation.inprocessing.commons.regression import _losses as rl
from holisticai.bias.mitigation.inprocessing.grid_search.algorithm import GridSearchAlgorithm
from holisticai.utils.transformers.bias import BMInprocessing as BMImp
from sklearn.base import BaseEstimator, clone


class GridSearchReduction(BMImp, BaseEstimator):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import numpy as np
import pandas as pd
import scipy

from holisticai.bias.mitigation.postprocessing.lp_debiaser.multiclass_balancer import algorithm_utils as tools


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from typing import Literal

import numpy as np

from holisticai.bias.mitigation.postprocessing.lp_debiaser.multiclass_balancer.algorithm import (
MulticlassBalancerAlgorithm,
)
Expand Down Expand Up @@ -182,4 +181,4 @@ def _get_catalogs(self):

obj_cat = {"macro": MacroLosses, "micro": MicroLosses}

return cons_cat, obj_cat
return cons_cat, obj_cat
1 change: 0 additions & 1 deletion src/holisticai/datasets/_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
if TYPE_CHECKING:
from collections.abc import Iterable

import json

import numpy as np
from numpy.random import RandomState
Expand Down
2 changes: 1 addition & 1 deletion src/holisticai/datasets/_load_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def load_law_school_dataset(
if preprocessed:
y = y.map({"FALSE": 0, "TRUE": 1}).astype("category")
X = df.drop(drop_columns, axis=1)

if protected_attribute is not None:
if protected_attribute == "race":
ga_label = "white"
Expand Down
2 changes: 1 addition & 1 deletion src/holisticai/pipeline/_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,4 @@ def repr_info(self):
"dtype": self.__class__.__name__,
"attributes": {},
"nested_objects": nested_objects,
}
}
2 changes: 1 addition & 1 deletion src/holisticai/utils/transformers/bias/_inprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@ def repr_info(self):
"attributes": {
"Type": "Bias Mitigation Inprocessing",
},
}
}
2 changes: 1 addition & 1 deletion src/holisticai/utils/transformers/bias/_postprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,4 @@ def repr_info(self):
"attributes": {
"Type": "Bias Mitigation Postprocessing",
},
}
}
2 changes: 1 addition & 1 deletion src/holisticai/utils/transformers/bias/_preprocessing.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ def repr_info(self):
"attributes": {
"Type": "Bias Mitigation Preprocessing",
},
}
}

0 comments on commit b86c786

Please sign in to comment.