Skip to content

Exponentiated gradient implementation for bounded group loss#442

Merged
MiroDudik merged 72 commits into
fairlearn:masterfrom
dgiova:davide/exponentiated_gradient-BGL
Aug 4, 2020
Merged

Exponentiated gradient implementation for bounded group loss#442
MiroDudik merged 72 commits into
fairlearn:masterfrom
dgiova:davide/exponentiated_gradient-BGL

Conversation

@dgiova

@dgiova dgiova commented May 29, 2020

Copy link
Copy Markdown
Contributor

Summary of contributions:

  • added signed_weights method for default objective.
  • implemented logic to compute the best response estimator for bounded group loss.
  • developed method to produce randomized predictions, given the set of estimators produced by the exponentiated gradient optimization.

closes #380

Roman Lutz and others added 30 commits April 8, 2020 15:17
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
…rolutz/exponentiated_gradient_tests

Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
gamma and eps + test codes in BGL
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
@romanlutz romanlutz added enhancement New feature or request feature-request labels Jun 15, 2020
@romanlutz romanlutz added this to the Fair Regression with ExponentiatedGradient milestone Jun 15, 2020
@romanlutz romanlutz removed this from the Fair Regression with ExponentiatedGradient milestone Jun 22, 2020
Roman Lutz added 2 commits July 8, 2020 19:37
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
@romanlutz

Copy link
Copy Markdown
Member

CHANGES.md has this already from the previous PR, documentation (user guide) exists now for the moment, although we still need to write the expgrad user guide (separate PR), eps removed from lagrangian constructor, but tests for BGL still missing.

Roman Lutz added 8 commits July 9, 2020 00:10
…c format

Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
…all moments

Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Comment thread fairlearn/reductions/_moments/utility_parity.py Outdated

@riedgar-ms riedgar-ms left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure there aren't two separate changesets here, but I'm not sure it's worth the trouble to separate them.

y = self.flipped_y
else:
y = self.y
smoke_test_data_regression = [

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two issues with the current tests:

  • you also need to check expgrad.weights_ not just expgrad.predictors_
  • it would be good to try setting upper_bound to a value that's different from eps and something that would make the problem feasible--currently all your examples have infeasible constraints... so you could maybe try upper_bound=0.05, which would make some of the examples feasible and some infeasible; i'd also suggest setting nu=1e-6 or 1e-3 and max_iter=20 in these runs (since the automatic setting of nu needs to be double-checked and might change in the future)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • yes! Updated.
  • Good point. I thought that's an issue since the gap doesn't go to 0. Will add a few more tests, although I'll leave the existing ones there as well. In practice that can happen, too, and we should have tests covering that. I'm adding the tests for upper_bound=0.05 with best_gap=0.0. Regarding nu and max_iter restrictions: The number of iterations is never larger than 5 or 6 so that wouldn't do anything, and that applies even when I set nu to 1e-6. I've added it anyway for now, but just so you're aware.

labels = [int(x) for x in '0110100' '0010111' '001111'] # noqa: E222
X1 = [int(x) for x in '0110101' '0111101' '001011'] # noqa: E222
X2 = [int(x) for x in '0000100' '0000011' '111111'] # noqa: E222
X3 = [int(x) for x in '1111111' '1111111' '111111'] # noqa: E222

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks buggy, you probably mean float(x)/10 or int(x)/10.0?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope.

>>> int(7)/10
0.7

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's all identical.

labels = [int(x) for x in '0110100' '0010111' '001111'] # noqa: E222
X1 = [int(x) for x in '0110101' '0111101' '001011'] # noqa: E222
X2 = [int(x) for x in '0000100' '0000011' '111111'] # noqa: E222
X3 = [int(x) for x in '1111111' '1111111' '111111'] # noqa: E222

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't love this calling convention. The issue is that if you sat y_as_scores to True, it's not just a matter of returning y as real values, you are actually returning a completely different y. But... I don't necessarily want to be overly pedantic here... so okay to leave as is.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, just a test utility, not an API that we expect anyone to use.

Roman Lutz added 2 commits August 3, 2020 17:24
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
Signed-off-by: Roman Lutz <rolutz@microsoft.com>
@MiroDudik MiroDudik merged commit 924ec4e into fairlearn:master Aug 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ENH - ExponentiatedGradient: use only classifiers with non-zero weights for predictions

7 participants