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

Support scikit-learn version < 1.2.0 #136

Closed
LeoGrin opened this issue Jan 14, 2025 · 5 comments
Closed

Support scikit-learn version < 1.2.0 #136

LeoGrin opened this issue Jan 14, 2025 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@LeoGrin
Copy link
Collaborator

LeoGrin commented Jan 14, 2025

See discussion here: #135
Please react to this if this is important to you.

@LeoGrin LeoGrin added enhancement New feature or request good first issue Good for newcomers labels Jan 14, 2025
@M-Colley
Copy link

M-Colley commented Feb 7, 2025

I think this is very important and - at the same time - support for the newer versions should be worked on.

I use sckit-learn in version 1.6.1 and receive these warnings:

FutureWarning: BaseEstimator._validate_datais deprecated in 1.6 and will be removed in 1.7. Usesklearn.utils.validation.validate_data instead.

FutureWarning: 'force_all_finite' was renamed to 'ensure_all_finite' in 1.6 and will be removed in 1.8.

@LeoGrin
Copy link
Collaborator Author

LeoGrin commented Feb 11, 2025

Thanks @M-Colley for the feedback! Good to know that supporting sklearn<1.2 is important for you.
Support for new sklearn versions should be fixed with #180, so there shouldn't be these warnings anymore.

@LeoGrin
Copy link
Collaborator Author

LeoGrin commented Feb 11, 2025

Concerning sklearn<1.2, I'll note that sklearn-compat which we're now using for being compatible with multiple sklearn versions doesn't support older versions, which apparently matches the SPEC0 recommendations.

When it comes to support multiple scikit-learn versions, the initial plan as of December 2024 is to follow the SPEC0 recommendations. It means that this utility will support at least the scikit-learn versions up to 2 years or about 4 versions. The current version of sklearn-compat supports scikit-learn >= 1.2.

@gkmngrgn
Copy link

@LeoGrin hi! I also investigated the issue and seems the problem is a bit more deep than I thought. I didn't see the use of python_requires attribute on setup.py but I confirmed that the older versions of scikit-learn are not installable on Python 3.12. because of a deprecated attribute (I'm getting the same output with version 1.1.3):

(venv) goedev@griloyama:~/workspace/test-tabfpn$ pip install "scikit-learn==1.2.0"
Collecting scikit-learn==1.2.0
  Using cached scikit-learn-1.2.0.tar.gz (7.2 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [33 lines of output]
      Traceback (most recent call last):
        File "/home/goedev/workspace/test-tabfpn/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>
          main()
        File "/home/goedev/workspace/test-tabfpn/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 373, in main
          json_out["return_val"] = hook(**hook_input["kwargs"])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/goedev/workspace/test-tabfpn/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 137, in get_requires_for_build_wheel
          backend = _build_backend()
                    ^^^^^^^^^^^^^^^^
        File "/home/goedev/workspace/test-tabfpn/venv/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 70, in _build_backend
          obj = import_module(mod_path)
                ^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/lib/python3.12/importlib/__init__.py", line 90, in import_module
          return _bootstrap._gcd_import(name[level:], package, level)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1310, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
        File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
        File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
        File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
        File "<frozen importlib._bootstrap_external>", line 995, in exec_module
        File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
        File "/tmp/pip-build-env-nqow1z40/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 16, in <module>
          import setuptools.version
        File "/tmp/pip-build-env-nqow1z40/overlay/lib/python3.12/site-packages/setuptools/version.py", line 1, in <module>
          import pkg_resources
        File "/tmp/pip-build-env-nqow1z40/overlay/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2172, in <module>
          register_finder(pkgutil.ImpImporter, find_on_path)
                          ^^^^^^^^^^^^^^^^^^^
      AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Maybe it's better to support scikit-learn<1.2.0 only on tabfpn<2.0.0?

@LeoGrin
Copy link
Collaborator Author

LeoGrin commented Feb 14, 2025

Thanks @gkmngrgn for looking into this! I actually think it makes sense to follow SPEC0, which means supporting scikit-learn from 1.2.0 for now. Closing now, feel free to reopen if you disagree @noahho

@LeoGrin LeoGrin closed this as completed Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants