BinPro / CONCOCT

Clustering cONtigs with COverage and ComposiTion
Other
122 stars 48 forks source link

scikit-learn dependencies in devel branch #213

Closed defleury closed 5 years ago

defleury commented 6 years ago

I've cloned the devel branch like so:

git clone git@github.com:BinPro/CONCOCT.git
git fetch
git checkout SpeedUp_Mp

Installation runs fine, but when trying to run concoct I realised that my scikit-learn version may be too new (0.20.0). I got this error:

Traceback (most recent call last):
  File "bin/concoct", line 13, in <module>
    from concoct.cluster import cluster
  File "[my_place]/miniconda3/envs/concoct/lib/python2.7/site-packages/concoct-0.5.0-py2.7-linux-x86_64.egg/concoct/cluster.py", line 4, in <module>
    from sklearn.mixture import GMM
ImportError: cannot import name GMM

I am not a Pythonian, but a quick online search told me that method GMM was deprecated in favour of GaussianMixture during the move from scikit-learn 0.17 to 0.18:

http://scikit-learn.org/0.18/whats_new.html

The old mixture.GMM is deprecated in favor of the new mixture.GaussianMixture. The new class computes the Gaussian mixture faster than before and some of computational problems have been solved. #6666 by Wei Xue and Thierry Guillemot

I do not know whether this is a drop-in replacement, or whether further dependencies would break by moving to a newer scikit-learn.

When re-installing with scikit-learn 0.17.0, I got rid of the error.

alneberg commented 5 years ago

Hi @defleury,

thank you for this very clear report! I think you are completely right. I think however this is adjusted in the devel branch: https://github.com/BinPro/CONCOCT/commit/8cda4103de38a74db5827c1562cef9924b906f9b

The changes made in SpeedUp_MP should now be included in the devel branch so that is the recommended one to use until we have created a new release with these changes included.

I'll close this issue now, let me know if you are not satisfied with the solution in the commit above.