CostSensitiveClassification icon indicating copy to clipboard operation
CostSensitiveClassification copied to clipboard

ModuleNotFoundError

Open DanitShifmanAbukasis opened this issue 3 years ago • 2 comments

Hi, Importing the library fails with errors including:

  • No module named 'sklearn.externals.joblib'
  • ImportError: cannot import name 'six' from 'sklearn.externals'
  • ModuleNotFoundError: No module named 'sklearn.externals.six.moves' Do you familiar with those errors and know how to handle them? Thanks in advance! Danit.

DanitShifmanAbukasis avatar Jun 15 '21 15:06 DanitShifmanAbukasis

I am having a similar error too.

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-117-fa33478a481d> in <module>
----> 1 from costcla.models import BayesMinimumRiskClassifier

~\anaconda3\lib\site-packages\costcla\__init__.py in <module>
     29 from .metrics import *
     30 from .datasets import *
---> 31 from .models import *
     32 

~\anaconda3\lib\site-packages\costcla\models\__init__.py in <module>
      4 
      5 from .directcost import BayesMinimumRiskClassifier, ThresholdingOptimization
----> 6 from .regression import CostSensitiveLogisticRegression
      7 from .cost_tree import CostSensitiveDecisionTreeClassifier
      8 

~\anaconda3\lib\site-packages\costcla\models\regression.py in <module>
     11 from sklearn.base import BaseEstimator
     12 # from sklearn.linear_model.logistic import _intercept_dot
---> 13 from pyea import GeneticAlgorithmOptimizer
     14 from ..metrics import cost_loss
     15 

~\anaconda3\lib\site-packages\pyea\__init__.py in <module>
     11 
     12 
---> 13 from .models import *

~\anaconda3\lib\site-packages\pyea\models\__init__.py in <module>
----> 1 from .ga import GeneticAlgorithmOptimizer

~\anaconda3\lib\site-packages\pyea\models\ga.py in <module>
     10 import pandas as pd
     11 from scipy.stats import norm
---> 12 from sklearn.externals.joblib import Parallel, delayed, cpu_count
     13 import itertools
     14 

ModuleNotFoundError: No module named 'sklearn.externals.joblib'

joeanton719 avatar Jun 17 '21 15:06 joeanton719

I solved it locally on my computer by changing the imports where needed.

DanitShifmanAbukasis avatar Jun 23 '21 12:06 DanitShifmanAbukasis