Closed NikkiRoodenrijs closed 2 years ago
Thanks @NikkiRoodenrijs for reporting this issue.
The problem is due to some rounding error. This is because currently we apply the constraints in the standardized feature space and then project the features back to the original input space by the reverse transformation. For integer features, we cast them back to int
and this can cause the projected feature to differ by 1 from the original value.
We will fix this problem shortly.
@NikkiRoodenrijs, PR #550 solves the issue you mentioned. It will be probably merged soon into the master branch, but if it is urgent, then you can use the implementation in the PR.
Thank you for reporting the issue and please let me know if this fixes the problem.
Unfortunately, this does not solve the issue. The following error appears when I fit the explainer.
@NikkiRoodenrijs, that is caused by your numpy
version.
When I tested it I used 1.20.3
. I will soon modify the code to work for older versions too. Thanks!
It now works for me! Thanks!!
Closed by #550.
Hi!!
For the function CounterFactualRLTabular the ranges for age are defined in such a way that the age feature cannot decrease. However, I noticed, running the exact same notebook "Counterfactual with Reinforcement Learning (CFRL) on Adult Census" (https://github.com/SeldonIO/alibi/blob/master/examples/cfrl_adult.ipynb), with the only change being that I run the counterfactual instances for more than 5 examples (see line 18/19), that for some instances the age decreased. For example in line 9 the original instance the age is 47 and for the counterfactual instance it is 48.
Since I am not getting any errors or warnings, I think that there is a bug in the code. Can you confirm this to me or do you think there is another problem that causes the counterfactual instance to be out of the predefined range. I hope you can give me some advice as to how to cope with the generated counterfactuals being out of the predefined ranges.
Best, Nikki