SeldonIO / alibi

Algorithms for explaining machine learning models
https://docs.seldon.io/projects/alibi/en/stable/
Other
2.42k stars 252 forks source link

Is Anchor in this implementation suitable for one-hot encoding tabular dataset ? #602

Open chenz1hao opened 2 years ago

chenz1hao commented 2 years ago

Just shifted from that original Anchor implementation (implemented by paper's author), encounted a problem so wonder if it is exist in this implementation too.

My features had been encoded into one-hot. like ['loan_amount<500','loan_amount>=500'] with values [[0,1],[1,0],[0,1]]. target is 0 or 1 indicates Fully-paid or Charged-off for a single loan applicant.

But the result I get from that implementation is strange: image as you can see, There is no values like 'n', 'a' or 'g' in feature values. So I submitted an issue in that repo but no answer till now.

So I wonder whether this problem exists in this implementation or not.

I noticed there is "ohe=True" parameters in Anchor_tabular function, is that what I actually need?

Thank you.

mauicv commented 2 years ago

Hey @chenz1hao, Thanks for opening the issue. I've not seen any errors like that for alibi. Our AnchorTabular implementation allows for a mix of numerical and categorical features. The categorical features can be ordinally or one-hot-encoded and this is indicated by the value of the ohe parameter. You can see an example of AnchorTabular applied to numerical and categorical data here and there is also relevant discussion here.

chenz1hao commented 2 years ago

Hey @chenz1hao, Thanks for opening the issue. I've not seen any errors like that for alibi. Our AnchorTabular implementation allows for a mix of numerical and categorical features. The categorical features can be ordinally or one-hot-encoded and this is indicated by the value of the ohe parameter. You can see an example of AnchorTabular applied to numerical and categorical data here and there is also relevant discussion here.

Thank you for answering. I just tried to import this libary, but got error be like: image Seems like error from TF, I just want use AnchorTabular, is it related to TF, I don't understand. Thank you.

jklaise commented 2 years ago

@chenz1hao what version of Tensorflow and Keras do you have installed (ideally, can you post the full pip freeze output)? It's most likely to do with older versions.