[go: up one dir, main page]

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

Unable to import LazyRegressor from lazypredict.Supervised #1

Closed
pedwrds opened this issue Feb 1, 2024 · 1 comment · Fixed by #2
Closed

Unable to import LazyRegressor from lazypredict.Supervised #1

pedwrds opened this issue Feb 1, 2024 · 1 comment · Fixed by #2
Assignees
Labels
bug Something isn't working

Comments

@pedwrds
Copy link
Owner
pedwrds commented Feb 1, 2024

Describe the bug

Since the release of scikit-learn 1.4.0, the pipeline to transform categorical components for lazypredict.Supervised.LazyRegressor is broken (2024/02/1). Importing this class results in a TypeError (below).

To Reproduce
Steps to reproduce the behavior:

from lazypredict.Supervised import LazyRegressor

Expected behavior
Expect LazyRegressor class to be available.

Screenshots

In [1]: from lazypredict.Supervised import LazyRegressor
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In[1], line 1
----> 1 from lazypredict.Supervised import LazyRegressor

File ~/Library/Caches/pypoetry/virtualenvs/quantumdatasets--D7t3edE-py3.10/lib/python3.10/site-packages/lazypredict/Supervised.py:98
     89 # CLASSIFIERS.append(('CatBoostClassifier',catboost.CatBoostClassifier))
     91 numeric_transformer = Pipeline(
     92     steps=[("imputer", SimpleImputer(strategy="mean")), ("scaler", StandardScaler())]
     93 )
     95 categorical_transformer_low = Pipeline(
     96     steps=[
     97         ("imputer", SimpleImputer(strategy="constant", fill_value="missing")),
---> 98         ("encoding", OneHotEncoder(handle_unknown="ignore", sparse=False)),
     99     ]
    100 )
    102 categorical_transformer_high = Pipeline(
    103     steps=[
    104         ("imputer", SimpleImputer(strategy="constant", fill_value="missing")),
   (...)
    107     ]
    108 )
    111 # Helper function

TypeError: OneHotEncoder.__init__() got an unexpected keyword argument 'sparse'

Desktop (please complete the following information):

  • MacOS: 12.7.3
@pedwrds pedwrds added the bug Something isn't working label Feb 1, 2024
@pedwrds pedwrds self-assigned this Feb 1, 2024
@pedwrds
Copy link
Owner Author
pedwrds commented Feb 1, 2024

Likely cause & fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant