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

Counterfactuals dataframes have rounded target values #440

Open
Mchristos opened this issue Jun 18, 2024 · 2 comments
Open

Counterfactuals dataframes have rounded target values #440

Mchristos opened this issue Jun 18, 2024 · 2 comments

Comments

@Mchristos
Copy link

Mchristos commented Jun 18, 2024

I've noticed that the counterfactuals dataframes I get from my CounterfactualExamples objects have the target value rounded to the nearest decimal place. This makes the results useless to me, since in my dataset has target values very close to zero, and the distribution is very skewed towards zero. I.e. many data points occur between 0.0 and 0.1.

I've included a modified version of this getting started notebook which shows that example.final_cfs_df (where example: CounterfactualExamples) contains rounded target values, but examples.visualize_dataframe() clearly shows that the higher precision target value is stored somewhere.

image
@Mchristos
Copy link
Author

For future travellers: I've found that using example.final_cfs_df_sparse returns the desired precision in the predictions. I haven't found a way to keep the original precision in the "instance" df

@Mchristos
Copy link
Author

As for the "instance" dataframe, my best solution was to simply use the original dataframe passed to DiCE rather than use it's output. As for the predicted target value, simply do prediction with your model on your "instance" data.

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