Reputation: 11
Code:
onehotencoder = OneHotEncoder(categorical_features = [3])
resulting in the error:
TypeError: __init__() got an unexpected keyword argument 'categorical_features'
Upvotes: 0
Views: 149
Reputation: 5157
As Chris said, the categorical_features
parameter for preprocessing.OneHotEncoder
was deprecated with version 0.20 of scikit-learn. See the relevant release notes, commit, pull request, and issue for the deprecation. It was then removed in version 0.22. See the PR and commit for the removal.
Upvotes: 1