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

Pandas 1.0.0rc0/0.6.1 module 'sklearn.preprocessing' has no attribute 'Imputer' #127

Open
apiszcz opened this issue Jan 19, 2020 · 11 comments

Comments

@apiszcz
Copy link

apiszcz commented Jan 19, 2020

SKLEARN

sklearn.preprocessing.Imputer
Warning
DEPRECATED

class sklearn.preprocessing.Imputer(*args, **kwargs)[source]
Imputation transformer for completing missing values.

Read more in the User Guide.


---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-e0471065d85c> in <module>
      1 import pandas as pd
      2 import numpy as np
----> 3 import pandas_ml as pdml
      4 a1 = np.random.randint(0,2,size=(100,2))
      5 df = pd.DataFrame(a1,columns=['i1','i2'])

C:\g\test\lib\pandas_ml\__init__.py in <module>
      1 #!/usr/bin/env python
      2 
----> 3 from pandas_ml.core import ModelFrame, ModelSeries       # noqa
      4 from pandas_ml.tools import info                         # noqa
      5 from pandas_ml.version import version as __version__     # noqa

C:\g\test\lib\pandas_ml\core\__init__.py in <module>
      1 #!/usr/bin/env python
      2 
----> 3 from pandas_ml.core.frame import ModelFrame       # noqa
      4 from pandas_ml.core.series import ModelSeries     # noqa

C:\g\test\lib\pandas_ml\core\frame.py in <module>
      8 
      9 import pandas_ml.imbaccessors as imbaccessors
---> 10 import pandas_ml.skaccessors as skaccessors
     11 import pandas_ml.smaccessors as smaccessors
     12 import pandas_ml.snsaccessors as snsaccessors

C:\g\test\lib\pandas_ml\skaccessors\__init__.py in <module>
     17 from pandas_ml.skaccessors.neighbors import NeighborsMethods                      # noqa
     18 from pandas_ml.skaccessors.pipeline import PipelineMethods                        # noqa
---> 19 from pandas_ml.skaccessors.preprocessing import PreprocessingMethods              # noqa
     20 from pandas_ml.skaccessors.svm import SVMMethods                                  # noqa

C:\g\test\lib\pandas_ml\skaccessors\preprocessing.py in <module>
     11     _keep_col_classes = [pp.Binarizer,
     12                          pp.FunctionTransformer,
---> 13                          pp.Imputer,
     14                          pp.KernelCenterer,
     15                          pp.LabelEncoder,

AttributeError: module 'sklearn.preprocessing' has no attribute 'Imputer'
@NamrataShahade
Copy link

Hi,
I am also getting the same error when I am trying to import :

      from sklearn.impute import SimpleImputer
      from pandas_ml import ConfusionMatrix
      import matplotlib.pyplot as plt

@eduard93
Copy link

eduard93 commented Mar 4, 2020

Same error persists on latest versions.

@gfranco008
Copy link

I am still getting this error

@olliiiver
Copy link

Had the same problem while trying some examples and Google brought me here.

sklearn.preprocessing.Imputer has been removed in 0.22.

Needed to downgrade.

pip3 install scikit-learn==0.21

pip3 install pandas==0.24.2

@ikostan
Copy link

ikostan commented Apr 7, 2020

I had same issue on my Colab platform. Following line from pandas_ml import ConfusionMatrix gave me the error.
Thank you @olliiiver, now it works fine

@gtangthousandeyes
Copy link

wow.

@cl886699
Copy link

from sklearn.impute import SimpleImputer
SimpleImputer(missing_values=np.nan, strategy='mean')

@FedericaBrando
Copy link

Same issue.
Downgrading didn't work for me

@kalilamali
Copy link

This worked for me:
You have to uninstall properly and downgrading will work.

! pip uninstall -y scikit-learn
! pip uninstall -y pandas
! pip uninstall -y pandas_ml

! pip install scikit-learn==0.21
! pip install pandas==0.24.2
! pip install pandas_ml

import pandas_ml as pdml

@code-JOA
Copy link

yeah facing the same problem today. Not worth the stress. I just deleted Pandas_ml . Problem solved.

@apiszcz
Copy link
Author

apiszcz commented Jun 25, 2020

The memories, #127

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