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

cannot import module BaggingClassifier #22

Open
avilella opened this issue Aug 23, 2017 · 3 comments
Open

cannot import module BaggingClassifier #22

avilella opened this issue Aug 23, 2017 · 3 comments
Labels

Comments

@avilella
Copy link

I tried to install scikit-mdr on an Ubuntu 14.04 Linux via pip install but got this error below. To make sure it wasn't a versions issue with scikit-learn, I did a sudo pip install -U scikit-learn, which completed successfully, then tried to load MDR on a python console. See below.

Any ideas?

Successfully installed scikit-learn
Cleaning up...
avilella@ubuntu14:~$ 
avilella@ubuntu14:~$ python
Python 2.7.6 (default, Oct 26 2016, 20:30:19) 
[GCC 4.8.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from mdr import MDR
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/mdr/__init__.py", line 23, in <module>
    from .mdr_ensemble import MDREnsemble
  File "/usr/local/lib/python2.7/dist-packages/mdr/mdr_ensemble.py", line 26, in <module>
    from sklearn.ensemble import BaggingClassifier
ImportError: cannot import name BaggingClassifier
@rhiever
Copy link
Contributor

rhiever commented Aug 23, 2017

One of the scikit-MDR algorithms uses scikit-learn's BaggingClassifier, which should be available in your installation of scikit-learn.

What version of scikit-learn is installed?

import sklearn
print sklearn.__version__

@avilella
Copy link
Author

avilella commented Aug 24, 2017 via email

@rhiever
Copy link
Contributor

rhiever commented Aug 24, 2017

That explains it. The latest version of scikit-learn is 0.19, and the BaggingClassifier was probably added after 0.14.1.

If you use the Anaconda distribution, I believe they have scikit-learn up-to-date for Python 2.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants