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

DOC add an example on how to optimize a metric with a constraint in TunedThresholdClassifierCV #28944

Open
glemaitre opened this issue May 3, 2024 · 3 comments

Comments

@glemaitre
Copy link
Member

We merged TunedThresholdClassifierCV in #26120.
However, we don't expose any way to optimize a metric that is constrained by another as one would do when choosing a point on the ROC or PR curves.

We should have an example that shows how to do such optimization as discussed here:
#26120 (review)

This would be a temporary trick until we settle on the best possible API regarding this constrained scorer.

@github-actions github-actions bot added the Needs Triage Issue requires triage label May 3, 2024
@adrinjalali
Copy link
Member

Probably also figure out a nice api that we can use for SearchCV as well

@jeremiedbb
Copy link
Member

I think that having a single scoring param able to handle constrained metrics as well would be ideal. In addition to make an example for that, we can maybe implement a helper for the main uses cases, precision at recall and tpr at tnr, that returns a ready-to-use scorer.

Probably also figure out a nice api that we can use for SearchCV as well

Do you think it would make sense to search over constraint values ? My understanding was that such constraint is determined by an external factor that you have no flexibility over.

@jeremiedbb jeremiedbb added New Feature Documentation and removed Needs Triage Issue requires triage labels May 6, 2024
@adrinjalali
Copy link
Member

At least in fairness related context, you might have a constraint on a fairness metric, and among those you want the best accuracy.

Or if you take the classical example, you want the model which has the least AIC/BIC within the 1 std of the test error of the best model.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

3 participants