mljar / mljar-supervised

Python package for AutoML on Tabular Data with Feature Engineering, Hyper-Parameters Tuning, Explanations and Automatic Documentation
https://mljar.com
MIT License
3k stars 401 forks source link

When trying to import AutoML it aborts #35

Closed miqueet closed 4 years ago

miqueet commented 4 years ago
>>> import pandas as pd
>>> from supervised.automl import AutoML
/root/python/MLwebsite/lib/python3.6/site-packages/sklearn/externals/joblib/__init__.py:15: DeprecationWarning: sklearn.externals.joblib is deprecated in 0.21 and will be removed in 0.23. Please import this functionality directly from joblib, which can be installed with: pip install joblib. If this warning is raised when loading pickled models, you may need to re-serialize those models with scikit-learn 0.21+.
  warnings.warn(msg, category=DeprecationWarning)
Aborted

this takes about 30 seconds to complete and ends in me returning to bash and not python. I am just attempting to run the quick example in the readme and I have python 3.6.3 in a brand new venv with nothing but this installed via pip.

pplonski commented 4 years ago

Can you paste full code? Which system are you using?

miqueet commented 4 years ago
import pandas as pd
from supervised.automl import AutoML

df = pd.read_csv("https://raw.githubusercontent.com/pplonski/datasets-for-start/master/adult/data.csv", skipinitialspace=True)

X = df[df.columns[:-1]]
y = df["income"]

automl = AutoML()
automl.fit(X, y)

predictions = automl.predict(X)

I just remembered I had this issue with tdqm and had to upgrade to 4.33.0

https://github.com/tqdm/tqdm/issues/555

Would this cause the abort I am seeing. I couldn't import the files without upgrading.

This is the error I get when using the standard tqdm version

>>> from supervised.automl import AutoML
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/dist-packages/tqdm/_tqdm.py", line 613, in pandas
    from pandas.core.groupby.groupby import DataFrameGroupBy, \
ImportError: cannot import name 'DataFrameGroupBy'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/supervised/__init__.py", line 3, in <module>
    from supervised.automl import AutoML
  File "/usr/local/lib/python3.6/dist-packages/supervised/automl.py", line 10, in <module>
    tqdm.pandas()
  File "/usr/local/lib/python3.6/dist-packages/tqdm/_tqdm.py", line 616, in pandas
    from pandas.core.groupby import DataFrameGroupBy, \
ImportError: cannot import name 'PanelGroupBy'
pplonski commented 4 years ago

Yes, that might be the issue. Please see this PR https://github.com/mljar/mljar-supervised/pull/30/commits/c3363c4753cd8bc33b8549d935f96ab2752cd44b with "tqdm>=4.33"

miqueet commented 4 years ago

It did seem to work with python 3.7.3 on my laptop so the issue may just be with python 3.6. I will debug further tomorrow.

We can close this our as far as im concerned.