-
Notifications
You must be signed in to change notification settings - Fork 32
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
Blazing fast bootstrap stderrs for AUROC #190
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds bootstrap standard errors everywhere we report AUROC figures, fixing #116.
Doing this the naive way with
sklearn.metrics.roc_auc_score
turned out to be quite slow (over a full second on CPU for each layer). Luckily GPT-4 helped me write a custom PyTorch implementation of AUROC that supports batching, so the computation can be vectorized across all the bootstrap resampled datasets at once. The relevant functions areroc_auc
androc_auc_ci
inelk.metrics
. Even when run on the CPU,roc_auc_ci
is much faster (~20x) than the naive for-loop baseline; on GPU it's of course even faster than that. Basically the bootstrap CI is no longer a significant bottleneck, so you might as well useroc_auc_ci
wherever you want to compute an AUROC.This PR does depend on #179 even though it probably doesn't need to, because I was too lazy to rebase. I'm hoping #179 will get merged today anyway so it won't matter.
As a bonus, this PR allows us to get rid of our dependency on
sklearn
, although we do still need it as a[dev]
dependency for the tests.