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

sorted_highlow=True in ppi_distribution_label_shift_ci -> form_discrete_distribution #14

Open
justinkay opened this issue Jul 24, 2024 · 1 comment

Comments

@justinkay
Copy link

Hi @aangelopoulos -- have finally been playing around with PPI!

I found a potential bug here:

qfhat = form_discrete_distribution(Yhat_unlabeled, sorted_highlow=True)

sorted_highlow will return the distribution ordered by class frequency, which may not be the same order as the classes in the confusion matrix. So the following line:

point_estimate = nu @ Ahatinv @ qfhat

will break unless the classes happen to already be ordered by frequency. In the plankton example this does not cause problems, since there are more data points with label 0 than 1. However if one were to flip this distribution, i.e.

Y = ~Y
Yhat = ~Yhat
Y_unlabeled = ~Y_unlabeled
Yhat_unlabeled = ~Yhat_unlabeled

The PPI estimate breaks.

Removing sorted_highlow=True from this call seems to fix the issue.

Happy to submit a quick PR for this if my understanding is correct here.

@aangelopoulos
Copy link
Owner

aangelopoulos commented Jul 25, 2024 via email

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

No branches or pull requests

2 participants