Skip to content

FAI-926: Implement custom counterfactual goal criteria #140

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

Merged
merged 7 commits into from
Jan 26, 2023

Conversation

ruivieira
Copy link
Member

@ruivieira ruivieira commented Jan 10, 2023

FAI-926

This PR adds programmable goal criteria to the Python counterfactuals.

Goal criteria allow to pass arbitrarily complex functions as a goal (using the CF proposal predictions as inputs) for scenarios where a static goal might not be sufficient.
The criteria can be any Python function and may take either Pandas dataframes or Numpy arrays as inputs and must return a tuple consisting of distance and score.

This PR also abstracts some functionality previously on the Model wrapper class to a more generic CallableWrapper, since the goal criteria shares some common functionality with Model.

@ruivieira ruivieira added the kind/enhancement New feature or request label Jan 10, 2023
@ruivieira ruivieira self-assigned this Jan 10, 2023
@ruivieira ruivieira marked this pull request as ready for review January 10, 2023 21:57
Copy link
Contributor

@tteofili tteofili left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very neat, LGTM!

@ruivieira ruivieira merged commit 148e419 into trustyai-explainability:main Jan 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants