-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
FutureWarning
issued by scikit-learn
in opflow
#7097
Comments
Hi, I would like to work on this as my first issue. If someone wouldn't mind assigning me that would be great. Thanks! |
No problem, I'll assign it to you. |
See also #6904 where I suggest erroring on all (unexpected) warnings. |
Yeah, absolutely agreed on that. It's something I want too - I had started to work on reducing the number of allowed deprecation warnings as a precursor to this, but then other stuff took over. |
Hi @st4eve, how's it going? Do you need any help on getting this working? |
Thanks for following up with me. I am new to contributing and I was having trouble getting the tox test file to run properly. I am on a windows machine and for some reason the test file always throws:
ERROR: py38: InvocationError for command 'C:\Users\coshc\qiskit-terra\.tox\py38\Scripts\pip.EXE' install '-cC:\Users\coshc\qiskit-terra/constraints.txt' -U --exists-action w -e . (exited with code 1)
When running the entire test sweet. If I try to run the specific test_gradients.py test file then I am met with the error:
ModuleNotFoundError: No module named 'qiskit.quantum_info.states.cython.exp_value'
Finally, when I attempt to build the project from source after following the steps on the Qiskit website I end up with:
ERROR: Command errored out with exit status 1: 'C:\Users\coshc\anaconda3\envs\qiskitDevEnv\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\coshc\\qiskit-terra\\setup.py'"'"'; __file__='"'"'C:\\Users\\coshc\\qiskit-terra\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps Check the logs for full command out
I will likely have more questions when I am able to get this working.
Because of this I have been unable to see the specific deprecation warning that the issue was referring to. Apologies for the delays on my end as well. Been a busy few weeks of school for me.
|
We would probably need to see the full logs that those commands allude to, but most likely the problem is that you don't have a correctly working C compiler on your system. There's a little intro to the "building Terra from source" section on the website that says:
Have you got those installed? In particular, since that link seems to be slightly out of date now, you want the thing that's now marked "Build Tools for Visual Studio 2022", and if it ever gives you an option (I don't think it does), make sure that you install the C++ tools. |
I'd also recommend double checking you've followed all the steps in the Installing terra from source, including the final |
How is that going @st4eve ? I also would recommend you to ask for help in the channel |
Is this issue actually still present? I just ran the opflow tests and did not encounter any |
Yep - for example https://dev.azure.com/qiskit-ci/qiskit-terra/_build/results?buildId=34312&view=logs&jobId=8fcf860c-8d5a-5d3a-546e-59924dc71ae1&j=8fcf860c-8d5a-5d3a-546e-59924dc71ae1&t=d677ba53-4fc9-5372-ced6-0b4a8cddaca6 from line 2753 onwards. Perhaps you didn't have scikit-learn installed, so the tests were skipped? |
Hi, there is a difference between the deprecated |
@Cryoris, @woodsp-ibm: perhaps you know the answer to this question? |
Hi, following up on this if there's any updates? |
Since the |
Thanks, Christa. @prakharb10: the comment above is from the person who originally wrote the code, so we can go ahead with that. Since it may affect the exact results achieved from a given seed / set of initial points, we should include a one-line "upgrade" release note with the change mentioning that, but it should be sufficiently internal that we don't need any deprecation cycles, I think. |
Information
What is the current behavior?
With the new(ish)
scikit-learn
version 1.0, there is aFutureWarning
issued when using thenormalize
parameter ofLinearModel
, whichopflow
does when calculating gradients. This doesn't fail our tests (though perhaps it should), becauseFutureWarning
doesn't count as a type ofDeprecationWarning
.Steps to reproduce the problem
Run the test suite, especially
test.python.opflow.test_gradients.TestGradients.test_natural_gradient
.What is the expected behavior?
No future warning.
Suggested solutions
Fix
opflow
to handle fitting withStandardScaler
rather than the now-deprecatednormalize
parameter. This has existed for several minor releases ofscikit-learn
, so should be safe for us to do.The text was updated successfully, but these errors were encountered: