Skip to content

Deprecation warning with scipy=1.9.0 #24080

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

Closed
jonyscathe opened this issue Aug 2, 2022 · 3 comments
Closed

Deprecation warning with scipy=1.9.0 #24080

jonyscathe opened this issue Aug 2, 2022 · 3 comments
Labels

Comments

@jonyscathe
Copy link

Describe the bug

When running a fit with a Ride regression model we get:

DeprecationWarning: The 'sym_pos' keyword is deprecated and should be replaced by using 'assume_a = "pos"'. 'sym_pos' will be removed in SciPy 1.11.0.

Looking through the SciPy release notes, sym_pos was actually deprecated about 5 years ago, they just forgot to add the deprecation warning. Now that they have, it is probably best to make this change now before the sym_pos keyword is actually removed.

The argument is used 4 times within sklearn/linear_model/_ridge.py.

Steps/Code to Reproduce

import warnings

from sklearn import linear_model

warnings.simplefilter('always', DeprecationWarning)

reg = linear_model.Ridge(alpha=0.5, solver='cholesky')
reg.fit([[0, 0], [0, 0], [1, 1]], [0, 0.1, 1])

Expected Results

No warnings generated

Actual Results

/usr/local/lib/python3.10/site-packages/sklearn/linear_model/_ridge.py:212: DeprecationWarning: The 'sym_pos' keyword is deprecated and should be replaced by using 'assume_a = "pos"'. 'sym_pos' will be removed in SciPy 1.11.0.
return linalg.solve(A, Xy, sym_pos=True, overwrite_a=True).T

Versions

System:
    python: 3.10.5 (main, Jul 13 2022, 05:45:22) [GCC 10.2.1 20210110]
executable: /usr/local/bin/python
   machine: Linux-5.15.0-43-generic-x86_64-with-glibc2.31

Python dependencies:
      sklearn: 1.1.1
          pip: 22.1.2
   setuptools: 58.1.0
        numpy: 1.23.1
        scipy: 1.9.0
       Cython: None
       pandas: 1.4.3
   matplotlib: 3.5.2
       joblib: 1.1.0
threadpoolctl: 3.1.0

Built with OpenMP: True

threadpoolctl info:
       user_api: openmp
   internal_api: openmp
         prefix: libgomp
       filepath: /usr/local/lib/python3.10/site-packages/scikit_learn.libs/libgomp-a34b3233.so.1.0.0
        version: None
    num_threads: 32

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /usr/local/lib/python3.10/site-packages/numpy.libs/libopenblas64_p-r0-742d56dc.3.20.so
        version: 0.3.20
threading_layer: pthreads
   architecture: Zen
    num_threads: 32

       user_api: blas
   internal_api: openblas
         prefix: libopenblas
       filepath: /usr/local/lib/python3.10/site-packages/scipy.libs/libopenblasp-r0-9f9f5dbc.3.18.so
        version: 0.3.18
threading_layer: pthreads
   architecture: Zen
    num_threads: 32
@jonyscathe jonyscathe added Bug Needs Triage Issue requires triage labels Aug 2, 2022
@thomasjpfan
Copy link
Member

Thank you for opening this issue! This was fixed in 4b9d590.

I think it makes sense to include this change in 1.1.2 as a bug fix.

@thomasjpfan thomasjpfan removed the Needs Triage Issue requires triage label Aug 2, 2022
@jjerphan
Copy link
Member

jjerphan commented Aug 2, 2022

Should we add #23617 in the changelog for 1.1.2 or just close this issue as completed?

@thomasjpfan
Copy link
Member

thomasjpfan commented Aug 2, 2022

I placed #23617 on the 1.1.2 milestone. I expect it to be a part of 1.1.2.

As for the changelog, we normally do not add this type of maintenance fixes to the change log. Technically nothing broke, it's more to prevent future breakage. No strong opinion tho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants