Open Ezzaldin97 opened 9 months ago
Fixed here: https://github.com/nityansuman/lazypredict-nightly (PYPI: pip install lazypredict-nightly) @Ezzaldin97
Thanks @nityansuman 🙏
I am facing the same issue too :(
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[2], line 4
2 import numpy as np # linear algebra
3 import pandas as pd # data processing, CSV file I/O
----> 4 from lazypredict.Supervised import LazyRegressor
5 from sklearn.model_selection import train_test_split
6 from sklearn.preprocessing import LabelEncoder
File ~\anaconda3\Lib\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'
Description: There is an issue with OneHotEncoder, as it isn't accepting argument 'sparse'
explanation: recent versions of OneHotEncoder Object changed the 'sparse' argument to 'sparse_output', so this error is because of the issue in the dependencies version.
solution: this can be solved either by limiting the versions of the dependencies or handling the code to match the recent versions.
issue: