我如何解决sklearn.preprocessing的错误?

问题描述 投票:0回答:1

代码:

onehotencoder = OneHotEncoder(categorical_features = [3])

得到以下错误:

TypeError:init()获得了意外的关键字参数'categorical_features'

python pycharm sklearn-pandas
1个回答
0
投票

As Chris said,[c0]的categorical_features参数在scikit-learn的0.20版本中已弃用。弃用请参见preprocessing.OneHotEncoderpreprocessing.OneHotEncoderthe relevant release notescommit。然后在版本0.22中将其删除。请参阅pull requestissue进行删除。

© www.soinside.com 2019 - 2024. All rights reserved.