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

FEAT export InterpolatedThresholder as a public object and update its API (e.g., rename an argument) #918

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

romanlutz
Copy link
Member

This PR does the following:

Roman Lutz added 11 commits July 24, 2021 15:59
… example

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>
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 API Anything which touches on the API labels Jul 25, 2021
@MiroDudik MiroDudik changed the title FEAT rename the interpolation_dict argument of InterpolatedThresholder to threshold_interpolation FEAT export InterpolatedThresholder as a public object and update its API (e.g., rename an argument) Jul 26, 2021
Copy link
Member

@MiroDudik MiroDudik left a comment

Choose a reason for hiding this comment

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

Since we are taking a private object and making it public, we should review its API to make sure we like.

@@ -21,14 +21,13 @@ class InterpolatedThresholder(BaseEstimator, MetaEstimatorMixin):

At prediction time, the predictor takes as input both standard and sensitive features.
Based on the values of sensitive features, it then applies a randomized thresholding
transformation according to the provided `interpolation_dict`.
transformation according to the provided `threshold_interpolation`.
Copy link
Member

Choose a reason for hiding this comment

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

why this change? if you don't like the original, we should go for something more concise. maybe something like threshold_info or thresholding_info or even thresholds (but that is a bit confusing, because it sounds like the structure would be simpler).

Copy link
Member Author

Choose a reason for hiding this comment

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

Info isn't a great name. Everything is "info", yet we don't call "width" variables "width_info". It's a stylistic improvement as well as a description improvement: interpolation and threshold are the two important things worth mentioning IMO.
If you don't think it's an improvement I don't mind scrapping it, though (not the hill I choose to die on). It was originally part of an older PR about documenting post processing (which I'm actively working on) and got refactored out into its own change for simplicity.

Copy link
Member

Choose a reason for hiding this comment

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

How about threshold_weights since basically each value of a threshold gets a certain probabilistic weight?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't dislike it, but that's just p0 and p1 🙂

It's really not a bad name though...


Parameters
----------
estimator :
base estimator

interpolation_dict : dict
threshold_interpolation : dict
Copy link
Member

Choose a reason for hiding this comment

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

See my comment above re. naming. By the way, do we like the structure of this argument? The main reason why I've originally excluded this estimator from the module was that I wasn't sure we all liked this deep structure and I didn't want to commit to it... I usually prefer "shallower" input arguments.

from ._threshold_optimizer import ThresholdOptimizer # noqa: F401
from ._plotting import plot_threshold_optimizer # noqa: F401

__all__ = [
"ThresholdOptimizer",
"plot_threshold_optimizer"
"InterpolatedThresholder",
Copy link
Member

Choose a reason for hiding this comment

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

You'll also want to export ThresholdOperation. That's another structured object, where we should review whether we like its current API enough to make it external.

@romanlutz
Copy link
Member Author

Since we are taking a private object and making it public, we should review its API to make sure we like.

Adding to the list: tests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Anything which touches on the API enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants