Skip to content

Commit

Permalink
add pareto points fn
Browse files Browse the repository at this point in the history
  • Loading branch information
lacava committed Dec 19, 2023
1 parent f810a66 commit e7da3d0
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion fomo/estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,17 @@ def __init__(self,
self.checkpoint=checkpoint
self.picking_strategy=picking_strategy

def fit(self, X, y, grouping = 'intersectional', abs_val = False, gamma = True, protected_features=None, Xp=None, starting_point=None, **kwargs):
def fit(self,
X,
y,
grouping = 'intersectional',
abs_val = False,
gamma = True,
protected_features=None,
Xp=None,
starting_point=None,
**kwargs
):
"""Train the model.
Expand Down Expand Up @@ -357,6 +367,14 @@ def _get_signed_F(self, F=None):
F[:,i] = F[:,i]*m._sign
return F

def get_pareto_points(self):
"""Return a Pandas dataframe of the Pareto archive points"""
archive = pd.DataFrame(
self._get_signed_F(),
columns=self.accuracy_metrics_ + self.fairness_metrics_
)
return archive

class FomoClassifier(FomoEstimator, ClassifierMixin, BaseEstimator):
"""FOMO Classifier.
Expand Down

0 comments on commit e7da3d0

Please sign in to comment.