fdtomasi / regain

REGAIN (Regularised Graphical Inference)
BSD 3-Clause "New" or "Revised" License
28 stars 13 forks source link

Attempting to import regain.linear_model raises error #29

Closed DManowitz closed 1 year ago

DManowitz commented 1 year ago

Describe the bug Attempting to import regain.linear_model raises error

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "...\lib\site-packages\regain\linear_model\__init__.py", line 31, in <module>
    from .group_lasso_overlap_ import GroupLassoOverlap, GroupLassoOverlapClassifier
  File "...\lib\site-packages\regain\linear_model\group_lasso_overlap_.py", line 39, in <module>
    from sklearn.linear_model.base import LinearClassifierMixin, LinearModel, _pre_fit
ModuleNotFoundError: No module named 'sklearn.linear_model.base'

To Reproduce Install regain and scikit-learn >=1.0.2 (or possibly earlier version) Attempt to import regain.linear_model

Expected behavior No error

Screenshots N/A

Desktop (please complete the following information):

fdtomasi commented 1 year ago

Thank you for raising this. I updated scikit-learn and relative imports. Feel free to re-open in case you still have issues.

DManowitz commented 1 year ago

I see that you raised the required scikit-learn version to 1.2. However, scikit-learn >=1.1.0 requires Python 3.8, so that also means that this package will only work with Python 3.8+. Did you mean for that to be the case?

fdtomasi commented 1 year ago

I did not look into the specifics of the version, sorry. I am not sure when scikit-learn introduced the new module names (to be fair they change them pretty often) so I just used the latest version. This library does not use features of the new Python 3.8+ so would still work with previous versions. I can look edit the requirements to require scikit-learn >= 1.0 which should fix this!

fdtomasi commented 1 year ago

I added the requirements to include sklearn>=1.0 in v0.3.6. That should work -- they changed the name from linear_model.base to linear_model._base from this version.