pyod icon indicating copy to clipboard operation
pyod copied to clipboard

FeatureBagging issue with scikit-learn 0.24.0

Open jerome-plumecoq opened this issue 3 years ago • 3 comments

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'

jerome-plumecoq avatar Jan 06 '21 09:01 jerome-plumecoq

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

Matt-Wang88 avatar Jan 26 '21 06:01 Matt-Wang88

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'

nrcjea001 avatar Feb 11 '21 11:02 nrcjea001

as suggested, please update combo library to 0.1.2

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

yzhao062 avatar Feb 11 '21 15:02 yzhao062