TypeError Traceback(最近一次调用最后一次) [90] 中的单元格,第 3 行 1 #%pip install -r 要求.txt 2 导入惰性预测 ----> 3 from lazypredict.Supervised import LazyClassifier
文件 c:\Users\w23052945\AppData\Local naconda3\Lib\site-packages\lazypredict\Supervised.py:98 89 # CLASSIFIERS.append(('CatBoostClassifier',catboost.CatBoostClassifier)) 91 numeric_transformer = 管道( 92步=[("imputer", SimpleImputer(strategy="mean")), ("scaler", StandardScaler())] 93) 第95章 96步=[ 97(“imputer”,SimpleImputer(strategy =“constant”,fill_value =“missing”)), ---> 98(“编码”,OneHotEncoder(handle_unknown =“忽略”,稀疏= False)), 99] 100) 第102章 103步=[ 104(“imputer”,SimpleImputer(strategy =“constant”,fill_value =“missing”)), (...) 107] 108) 111 # 辅助函数
TypeError:OneHotEncoder。init()得到了意外的关键字参数“稀疏”
导入惰性预测 从lazypredict.Supervised导入LazyClassifier
这可能是因为您使用的
scikit-learn
版本不支持此参数。
您可以尝试在终端中通过以下命令升级
scikit-learn
:
pip install --upgrade scikit-learn