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

ImportError when importing xgbod #406

Closed
vaibhavkarve opened this issue May 13, 2022 · 3 comments
Closed

ImportError when importing xgbod #406

vaibhavkarve opened this issue May 13, 2022 · 3 comments

Comments

@vaibhavkarve
Copy link

Importing the xgbod model is throwing an import error. I suspect this is due to sklearn removing the _joblib_parallel_args fix from its latest version.

  • Python version = 3.10.4

  • OS = MacOS (darwin)

  • pyod version = 1.0.0

  • scikit-learn version = 1.1.0

  • Observed behavior (in the REPL) --

>>> import pyod.models.xgbod
lib/python3.10/site-packages/xgboost/compat.py:36: FutureWarning: pandas.Int64Index is deprecated and will be removed from pandas in a future version. Use pandas.Index with the appropriate dtype instead.
  from pandas import MultiIndex, Int64Index
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "lib/python3.10/site-packages/pyod/models/xgbod.py", line 26, in <module>
    from .iforest import IForest
  File "lib/python3.10/site-packages/pyod/models/iforest.py", line 13, in <module>
    from sklearn.utils.fixes import _joblib_parallel_args
ImportError: cannot import name '_joblib_parallel_args' from 'sklearn.utils.fixes' (/lib/python3.10/site-packages/sklearn/utils/fixes.py)

Expected behavior -- no error on importing the xgbod model.

yzhao062 pushed a commit that referenced this issue May 13, 2022
@yzhao062
Copy link
Owner

it actually caused by the underlying iforest's feature importance. will submit a new version today

@yzhao062
Copy link
Owner

pip install pyod==1.0.1 should fix the issue

@vaibhavkarve
Copy link
Author

That did indeed fix the import error. Thank you so much for such prompt action! 👍🏽 🥂

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

No branches or pull requests

2 participants