anchor icon indicating copy to clipboard operation
anchor copied to clipboard

categorical_features

Open renatodeleone opened this issue 4 years ago • 0 comments

When running anchor I receive the following error

explainer = anchor_tabular.AnchorTabularExplainer(possible_outcomes, feature_names, X2E, categorical_names) explainer.fit(X_train, y_train, X_test, y_test) Traceback (most recent call last):

File "", line 1, in explainer = anchor_tabular.AnchorTabularExplainer(possible_outcomes, feature_names, X2E, categorical_names)

File "anchor_tabular.py", line 43, in init self.encoder = sklearn.preprocessing.OneHotEncoder(

File "C:\compiler\anaconda3\lib\site-packages\sklearn\utils\validation.py", line 72, in inner_f return f(**kwargs)

TypeError: init() got an unexpected keyword argument 'categorical_features'

========================= I suspect that the problem is with OneHotEncoder https://stackoverflow.com/questions/59476165/typeerror-init-got-an-unexpected-keyword-argument-categorical-features

"Since the latest build of sklearn library removed categorical_features parameter for onehotencoder class. It is advised to use ColumnTransformer class for categorical datasets. Refer the sklearn's official documentation for futher clarifications."

Any help will be appreciated

renatodeleone avatar Jan 26 '21 15:01 renatodeleone