anchor icon indicating copy to clipboard operation
anchor copied to clipboard

Empty anchors

Open dblop opened this issue 6 years ago • 1 comments

I'm having a problem where the anchor appears to be computed (I look at the object and see e.g. features, examples, precision/coverage), but the names() attribute of the explanation is empty. I'm using the included discretizer on numerical variables for AnchorTabular. After some debug I found that add_names_to_exp() in anchor_tabular.py sometimes doesn't return a name (no condition is true, in my case a variable A > [value] has a leq mapped), probably because of errors in the mapping.

Going to the mapping: get_sample_fn() seems to be comparing values, yet uses

 for v in range(len(self.categorical_names[f]))

 if data_row[f] <= v:

Comparing data directly to a range? Is this intended? Same thing for conditions in sample_fn(). I'd need to debug more to confirm anything but this catched my attention.

Great paper btw

dblop avatar Mar 14 '18 00:03 dblop

Sorry for the bug and the delay in responding. The code you pasted is as intended - we assume that ordinal features were discretized, and thus have integer values in data_row. Would you be willing to share a notebook with an example of the bug? I think that would be the easiest way for me to figure out what's going on.

Thanks,

marcotcr avatar Mar 22 '18 22:03 marcotcr