I would like to use the use the from MissForest imputer from missingpy but I am having trouble successfully importing missingpy which fails with
...\venv\lib\site-packages\missingpy\knnimpute.py", line 13, in <module> from
sklearn.neighbors.base import _check_weights
ModuleNotFoundError: No module named 'sklearn.neighbors.base'
According to the following comment on GitHub one needs to use ( https://github.com/epsilon-machine/missingpy/issues/29 )
numpy==1.15.4
scipy==1.1.0
scikit-learn==0.20.1
pandas==0.25.3
I haven't tried to downgrade numpy, scipy or pandas yet but
pip install -U scikit-learn==0.20.1
fails with:
...
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for scikit-learn
Running setup.py clean for scikit-learn
Failed to build scikit-learn
WARNING: Ignoring invalid distribution -cikit-learn
(c:\users\laure\...\techcap\venv\lib\site-packages)
Installing collected packages: scikit-learn
Running setup.py install for scikit-learn ... error
error: subprocess-exited-with-error
× Running setup.py install for scikit-learn did not run successfully.
│ exit code: 1
╰─> [693 lines of output]
Based on a previous stackoverflow thread: No module named 'sklearn.neighbors._base'
I have also tried this:
import sklearn.neighbors._base
sys.modules['sklearn.neighbors.base'] = sklearn.neighbors._base
But this failed with:
File "c:\Users\laure\...\techcap\data_fetchers\data_fetcher.py", line 19, in <module>
sys.modules['sklearn.neighbors.base'] = sklearn.neighbors._base
NameError: name 'sklearn' is not defined
Any advice would be greatly appreciated.