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

create_counterfactual enhancements (minimization method and fixed features) #1029

Open
rasbt opened this issue Apr 18, 2023 Discussed in #1028 · 1 comment
Open

create_counterfactual enhancements (minimization method and fixed features) #1029

rasbt opened this issue Apr 18, 2023 Discussed in #1028 · 1 comment

Comments

@rasbt
Copy link
Owner

rasbt commented Apr 18, 2023

Discussed in #1028

Originally posted by farbodr April 17, 2023
I have a couple of questions about create_counterfactual?

  1. On a small table with the shape of (461, 75) it took about 22 min to return one row. Is there any way to speed this up?
  2. Is there any way to limit the features it uses? In other words, can I freeze some features and generate counterfactuals only for some of the features? For instance, in a healthcare use case, we know certain features can not be changed, like a health condition, but there are other features that can be changed that can impact the prediction.

Thanks,
FR

@rasbt
Copy link
Owner Author

rasbt commented Apr 18, 2023

Definitely good points.

  1. Off the top off my head, changing the minimization method might help, right now it's hardcoded to be Nelder-Mead. (https://github.com/rasbt/mlxtend/blob/master/mlxtend/evaluate/counterfactual.py#L113)

  2. And keeping some features fixed would probably help, too.

These would both require introducing 2 additional function arguments, which shouldn't be too complicated. But I am not sure if I have the capacity in the near future. Would appreciate PRs on that though!

PS: Converted this to an issue because these are good enhancement ideas!

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

No branches or pull requests

1 participant