Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visualize_as_dataframe show_only_changes doesn't appear to work with floating point numbers #356

Open
bdavj opened this issue Mar 15, 2023 · 0 comments

Comments

@bdavj
Copy link
Contributor

bdavj commented Mar 15, 2023

When setting show_only_changes=true, visualize_as_dataframe still appears to show all data, as the precision seems to be changing.

Would suggest there should be a fuzz factor in the comparison for display to avoid the FP comparison pitfalls.

AIUI, CounterfactualExamples uses the following:

if newli[ix][jx] == org[jx]:

Which introduces float comparison issues (i.e. in some cases, nothing with equate due to minor fluctuations, even if seemingly unchanged).

This should be using math.isclose with a factor of org[ix]/1000000 or similar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant