Skip to content

[BUG] Fairness regularization #674

@FBruzzesi

Description

@FBruzzesi

Description

While investigating a failing test on #671, I notice the following lines in _FairClassifier:

if self.penalty == "l1":
    log_likelihood -= cp.sum((1 / self.C) * cp.norm(theta[1:]))

However the default norm computed from cvxpy is p2 (docs).
Additionally cp.norm already sums the values over.

My suggestion to clean the API a bit is to:

  • Allow "l2" regularization (currently cannot be specified)
  • Correct the formula for "l1" regularization
  • "none" should be None (?)

Finally, the theta[1:] should only be valid for fit_intercept=True, otherwise we should use theta "entirely".

Am I missing something?

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingenhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions