yzhao062 / pyod

A Python Library for Outlier and Anomaly Detection, Integrating Classical and Deep Learning Techniques
http://pyod.readthedocs.io
BSD 2-Clause "Simplified" License
8.62k stars 1.37k forks source link

FeatureBagging issue with scikit-learn 0.24.0 #268

Open jerome-plumecoq opened 3 years ago

jerome-plumecoq commented 3 years ago

Hello, With the newly released scikit-learn 0.24.0, FeatureBagging is unusable (pyod v0.8.5)

cf. #252

In [7]: sklearn.__version__                    
Out[7]: '0.24.0'

In [8]: from pyod.models.feature_bagging import FeatureBagging                                 
---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-8-26a6c9623b87> in <module>
----> 1 from pyod.models.feature_bagging import FeatureBagging

~/gatewatcher/python_envs/gw_machine_learning_3.7/lib/python3.7/site-packages/pyod/models/feature_bagging.py in <module>
     22 from .base import BaseDetector
     23 from .sklearn_base import _partition_estimators
---> 24 from .combination import average, maximization
     25 from ..utils.utility import check_parameter
     26 from ..utils.utility import generate_indices

~/gatewatcher/python_envs/gw_machine_learning_3.7/lib/python3.7/site-packages/pyod/models/combination.py in <module>
      8 from __future__ import print_function
      9 
---> 10 from combo.models.score_comb import aom as combo_aom
     11 from combo.models.score_comb import moa as combo_moa
     12 from combo.models.score_comb import average as combo_average

~/gatewatcher/python_envs/gw_machine_learning_3.7/lib/python3.7/site-packages/combo/models/score_comb.py in <module>
     14 from sklearn.utils.extmath import weighted_mode
     15 from sklearn.utils.random import sample_without_replacement
---> 16 from sklearn.utils.testing import assert_equal
     17 from sklearn.utils.multiclass import check_classification_targets
     18 

ModuleNotFoundError: No module named 'sklearn.utils.testing'
Matt-Wang88 commented 3 years ago

Hello, There have same problem under scikit-learn 0.24.0 (or 0.24.1) with pyod 0.8.6.

nrcjea001 commented 3 years ago

Also having same issue with scikit-learn 0.24.1 and pyod 0.8.6

from pyod.models.combination import aom, moa

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-17-6ede6bd12bb9> in <module>
----> 1 from pyod.models.combination import aom, moa

~\Anaconda3\lib\site-packages\pyod\models\combination.py in <module>
      8 from __future__ import print_function
      9 
---> 10 from combo.models.score_comb import aom as combo_aom
     11 from combo.models.score_comb import moa as combo_moa
     12 from combo.models.score_comb import average as combo_average

~\Anaconda3\lib\site-packages\combo\models\score_comb.py in <module>
     14 from sklearn.utils.extmath import weighted_mode
     15 from sklearn.utils.random import sample_without_replacement
---> 16 from sklearn.utils.testing import assert_equal
     17 from sklearn.utils.multiclass import check_classification_targets
     18 

ModuleNotFoundError: No module named 'sklearn.utils.testing'
yzhao062 commented 3 years ago

as suggested, please update combo library to 0.1.2

pip install combo --upgrade https://github.com/yzhao062/pyod/issues/276