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

Example based #166

Merged
merged 32 commits into from
Oct 8, 2024
Merged

Example based #166

merged 32 commits into from
Oct 8, 2024

Conversation

AntoninPoche
Copy link
Collaborator

This PR is the same as #165 but with a clean commit history.

Introduce the Example-based module

This pull request introduces example-based methods from four families of methods. Namely:

  • Similar Examples
  • Semi-factuals
  • Counterfactuals
  • Prototypes

The API

The API is common for the four families, and it has three steps:

  • Construct a projection function with the model.
  • Initialize the method with a dataset, projection, and other parameters.
  • Explain given samples with a local explanation.
projection = ProjectionMethod(model)

explainer = ExampleMethod(
    cases_dataset=cases_dataset, 
    k=k,
    projection=projection,
    case_returns=case_returns,
    distance=distance,
)

examples = explainer.explain(inputs, targets)

AntoninPoche and others added 18 commits October 7, 2024 18:17
Co-authored-by: Adelin Constans <[email protected]>
Co-authored-by: Lucas Hervier <[email protected]>
Co-authored-by: Antonin Poché <[email protected]>
Co-authored-by: Antonin Poché <[email protected]>
Copy link
Collaborator

@lucashervier lucashervier left a comment

Choose a reason for hiding this comment

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

Everything was already discussed and treated in PR #165 . As it is the same PR with cleaned commits I approve without further comments.

@AntoninPoche AntoninPoche merged commit b05f896 into master Oct 8, 2024
15 checks passed
@AntoninPoche AntoninPoche deleted the example-based branch October 8, 2024 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants