alibi icon indicating copy to clipboard operation
alibi copied to clipboard

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

Open chenz1hao opened this issue 2 years ago • 3 comments

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.

chenz1hao avatar Mar 02 '22 09:03 chenz1hao

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.

mauicv avatar Mar 02 '22 09:03 mauicv

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.

chenz1hao avatar Mar 02 '22 13:03 chenz1hao

@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.

jklaise avatar Mar 07 '22 10:03 jklaise