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

Fixed AttributeError in metrics/roc_auc.py. #1568

Merged
merged 2 commits into from
Jul 19, 2024
Merged

Fixed AttributeError in metrics/roc_auc.py. #1568

merged 2 commits into from
Jul 19, 2024

Conversation

RavSS
Copy link
Contributor

@RavSS RavSS commented Jul 7, 2024

SciPy deprecated scipy.integrate.trapz long ago and it had instead
been renamed to scipy.integrate.trapezoid. The ROCAUC() class uses
the former instead of the latter (causing an AttributeError), with
the latter being included from the start of SciPy version 1.6.0 (start
of 2021). This is a small fix: I've added a simple hasattr() check for
compatibility with versions that still have scipy.integrate.trapz and
to use it if it's there over scipy.integrate.trapezoid, but it might be
unnecessary, since those versions are outdated.

https://docs.scipy.org/doc/scipy/release/1.6.0-notes.html#scipy-integrate-improvements

`scipy.integrate.trapezoid` replaced `scipy.integrate.trapz` in SciPy.
@gbolmier
Copy link
Member

Hey @RavSS, my apologies for the slow reply and thank you for the contribution!

I think it would make more sense to only use the new trapezoid function name instead and floor the SciPy dependency to 1.6.0. WDYT?

@gbolmier gbolmier linked an issue Jul 18, 2024 that may be closed by this pull request
@RavSS
Copy link
Contributor Author

RavSS commented Jul 19, 2024

I agree. It would make maintenance easier too; however, if the latest version of River still works with SciPy versions before 1.6.0 in other parts, then I think it's nice to keep the backwards compatibility at almost no cost for now.

@e10e3
Copy link
Contributor

e10e3 commented Jul 19, 2024

I would like to point out that the current version of River already requires SciPy to be in version 1.12 or greater (see the pyproject.toml).

No harm would be done in dropping support for SciPy anterior to 1.6.

@gbolmier
Copy link
Member

gbolmier commented Jul 19, 2024

Edit: Too fast for me @e10e3!

@RavSS I just noticed that our SciPy version is already floored to 1.12.1, no need to support scipy<1.6.0 versions then:

scipy = "^1.12.1"

Also Python >=3.10 were not supported before 1.6.

@gbolmier gbolmier merged commit 038ad5d into online-ml:main Jul 19, 2024
4 checks passed
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.

Expired deprecations in scipy v1.14 release break river metric
3 participants