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

Updated binom_test to binomtest in randomized_smoothing.py #2518

Closed
wants to merge 5 commits into from

Conversation

Ashuradhipathi
Copy link
Contributor

Description

Depreciated function name 'binom_test' of scipy being called while running predict method of TensorFlowV2RandomizedSmoothing object. The function scipy.stats.binom_test() was removed from SciPy 1.12.0.

Motivation: I have been trying to use art on kaggle but was faced with issues, hence I wanted to resolve it.

  1. I went throw stackoverflow and found that The function scipy.stats.binom_test() was removed from SciPy 1.12.0. So I changed the name to binomtest()
  2. binomtest accepts integer values only so I altered count1,count2 to integer values
  3. binomtest returns a BinomTestResult object, We are in need of pvalue which we can get using .pvalue

Reference: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.binomtest.html

Fixes #2517

Type of change

Please check all relevant options.

  • Improvement (non-breaking)
  • Bug fix (non-breaking)
  • New feature (non-breaking)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • My changes have been tested using both CPU and GPU devices

@beat-buesser beat-buesser self-requested a review November 18, 2024 12:22
@beat-buesser beat-buesser self-assigned this Nov 18, 2024
@beat-buesser beat-buesser added bug Something isn't working improvement Improve implementation labels Nov 18, 2024
@beat-buesser beat-buesser added this to the ART 1.19.0 milestone Nov 18, 2024
Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 53.29%. Comparing base (ea7bc9e) to head (9edd8da).

Additional details and impacted files

Impacted file tree graph

@@               Coverage Diff               @@
##           dev_1.19.0    #2518       +/-   ##
===============================================
- Coverage       82.31%   53.29%   -29.03%     
===============================================
  Files             334      668      +334     
  Lines           30997    61996    +30999     
  Branches         5298    10523     +5225     
===============================================
+ Hits            25516    33040     +7524     
- Misses           4033    27258    +23225     
- Partials         1448     1698      +250     
Files with missing lines Coverage Δ
...ation/randomized_smoothing/randomized_smoothing.py 97.33% <100.00%> (+0.03%) ⬆️

... and 344 files with indirect coverage changes

Ashuradhipathi and others added 3 commits November 19, 2024 15:44
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Signed-off-by: Prem Kiran Laknaboina <[email protected]>
Signed-off-by: Prem Kiran Laknaboina <[email protected]>
@beat-buesser beat-buesser changed the base branch from main to dev_1.19.0 December 3, 2024 16:42
@beat-buesser beat-buesser changed the base branch from dev_1.19.0 to main December 3, 2024 16:42
@beat-buesser beat-buesser changed the base branch from main to dev_1.19.0 December 3, 2024 16:43
@beat-buesser
Copy link
Collaborator

Hi @Ashuradhipathi Thank you very much for your pull request! I have merged your contributions to branch dev_1.19.0 for the upcoming release of ART 1.19.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working improvement Improve implementation
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Depreciated function name 'binom_test' of scipy.
2 participants