getzlab / SignatureAnalyzer

Updated SignatureAnalyzer-GPU with mutational spectra & RNA expression compatibility.
MIT License
71 stars 21 forks source link

missingpy refers to outdated sklearn module structure #28

Closed julianhess closed 3 years ago

julianhess commented 3 years ago

With a recent version of sklearn, importing signatureanalyzer returns the following error:

/mnt/j/local/miniconda3/envs/base38/lib/python3.8/site-packages/missingpy/knnimpute.py in <module>
     11 from sklearn.utils.validation import check_is_fitted
     12 from sklearn.utils.validation import FLOAT_DTYPES
---> 13 from sklearn.neighbors.base import _check_weights
     14 from sklearn.neighbors.base import _get_weights
     15

ModuleNotFoundError: No module named 'sklearn.neighbors.base'

This is because sklearn renamed sklearn.neighbors.base to sklearn.neighbors._base. A PR has been submitted to missingpy, but it appears that repo is dead (hasn't been updated since 2018): https://github.com/EvilTrtl/missingpy/tree/patch-1

Installing missingpy from that branch fixes the issue. We may want to amend setup.py to do the same, until the missingpy folks update their repo (if ever).

shankara-a commented 3 years ago

Honestly the imputation with sklearn works great for KNN. I should just remove missingpy for the next release and fix setup.py

Thanks for the heads up!

shankara-a commented 3 years ago

Removed missingpy from setup.py and the function that calls it.