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

Return the OOF instances for classifier-based drift detectors (ClassifierDrift and SpotTheDiffDrift) #665

Merged
merged 8 commits into from
Oct 25, 2022

Conversation

arnaudvl
Copy link
Contributor

When using the ClassifierDrift or SpotTheDiffDrift detectors, you can return the prediction probabilities on the out-of-fold instances. However, when you use train_size instead of cross-validation, you don't know which instances these probabilities correspond to, since you don't know which reference and test instances are used for training or prediction. This PR adds the associated reference and test instances to the detector's return dictionary.

@arnaudvl arnaudvl requested a review from jklaise October 24, 2022 15:21
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

alibi_detect/cd/base.py Outdated Show resolved Hide resolved
alibi_detect/cd/base.py Outdated Show resolved Hide resolved
Copy link
Contributor

@jklaise jklaise left a comment

Choose a reason for hiding this comment

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

LGTM pending CI passing.

@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2022

Codecov Report

Merging #665 (1fa1610) into master (47a0134) will increase coverage by 0.02%.
The diff coverage is 93.33%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #665      +/-   ##
==========================================
+ Coverage   79.09%   79.12%   +0.02%     
==========================================
  Files         126      126              
  Lines        8870     8895      +25     
==========================================
+ Hits         7016     7038      +22     
- Misses       1854     1857       +3     
Flag Coverage Δ
macos-latest-3.10 ?
ubuntu-latest-3.10 79.01% <93.33%> (+0.02%) ⬆️
ubuntu-latest-3.7 78.91% <93.33%> (+0.02%) ⬆️
ubuntu-latest-3.8 78.95% <93.33%> (+0.02%) ⬆️
ubuntu-latest-3.9 78.95% <93.33%> (+0.02%) ⬆️
windows-latest-3.9 76.17% <93.33%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
alibi_detect/cd/pytorch/spot_the_diff.py 90.90% <ø> (ø)
alibi_detect/cd/spot_the_diff.py 100.00% <ø> (ø)
alibi_detect/cd/tensorflow/spot_the_diff.py 93.22% <ø> (ø)
alibi_detect/cd/sklearn/classifier.py 91.53% <86.36%> (-1.74%) ⬇️
alibi_detect/cd/base.py 90.97% <100.00%> (+0.04%) ⬆️
alibi_detect/cd/pytorch/classifier.py 95.52% <100.00%> (+0.44%) ⬆️
alibi_detect/cd/tensorflow/classifier.py 96.82% <100.00%> (+0.33%) ⬆️

Copy link
Contributor

@jklaise jklaise left a comment

Choose a reason for hiding this comment

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

LGTM, would suggest updating the changelog as well to reduce burden come release time.

@arnaudvl arnaudvl merged commit 1af9fc0 into SeldonIO:master Oct 25, 2022
ascillitoe pushed a commit that referenced this pull request Nov 8, 2022
…fierDrift and SpotTheDiffDrift) (#665)

* add out-of-fold instances to the return dict for classifier detectors

* update docs

* update score return type

* fix typo and mypy error

* extend to list inputs and update score return types

* add Union import

* fix type error

* add changelog
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.

3 participants