Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Urbis Mystic Implementation #1321

Merged
merged 14 commits into from
Jun 23, 2023
Merged

Urbis Mystic Implementation #1321

merged 14 commits into from
Jun 23, 2023

Conversation

mfeffer
Copy link
Collaborator

@mfeffer mfeffer commented Jun 15, 2023

Using mystic solver from corresponding Python package to implement _pick_sizes for downsampling via Urbis. Also wrote a few unit tests to evaluate functionality and some utility functions that can be extended for upsampling via Orbis and (potentially) mixed sampling (i.e., both upsampling and downsampling).

Michael Feffer added 12 commits June 22, 2023 16:05
Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
…s swapping

Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
…added

Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
…n-closure issue

Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
Copy link
Member

@hirzel hirzel left a comment

Choose a reason for hiding this comment

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

Thanks a lot for the PR! I added a few comments below, could you please make those changes?

setup.py Outdated
@@ -66,6 +66,8 @@

extras_require = {
"full": [
"scikit-learn>=1.0.0,<=1.2.0",
Copy link
Member

Choose a reason for hiding this comment

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

I think this line should not be needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed!

@@ -84,11 +101,17 @@ def fit(self, X, y):
lambda row: "".join([str(v) for v in row]), axis=1
)
assert X.shape[0] == group_and_y.shape[0]
# TODO: Figure out a better workaround
Copy link
Member

Choose a reason for hiding this comment

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

After running ProtectedAttributeEncoder, I think should be able to unconditionally assume that the favorable labels are set([1]). However, I would not overwrite self.favorable_labels, because that would change the state of the object for future calls. Instead, why not just pass set([1]) into the _pick_sizes call below?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As discussed offline, I'm using LabelEncoder to encode the features separately and then construct a new set to pass to _pick_sizes by using the encoder's mapping and the classes in favorable_labels.

@@ -57,6 +70,8 @@ def __init__(
estimator,
unfavorable_labels=None,
redact=True,
imbalance_repair_level=0.8,
Copy link
Member

Choose a reason for hiding this comment

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

In addition to adding the hyperparameters to the constructor, we'll also need them in the _hyperparams_schema.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed!

…otectedAttributesEncoder)

Signed-off-by: Michael Feffer <mfeffer@Michaels-MacBook-Pro.local>
@mfeffer mfeffer merged commit eca0509 into IBM:master Jun 23, 2023
44 checks passed
@mfeffer mfeffer deleted the urbis-mystic-impl branch June 23, 2023 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants