Skip to content

Split Explainer into Base & Explainer#649

Merged
RobertSamoilescu merged 3 commits intoSeldonIO:masterfrom
RobertSamoilescu:meta_interface
May 4, 2022
Merged

Split Explainer into Base & Explainer#649
RobertSamoilescu merged 3 commits intoSeldonIO:masterfrom
RobertSamoilescu:meta_interface

Conversation

@RobertSamoilescu
Copy link
Contributor

@RobertSamoilescu RobertSamoilescu commented May 3, 2022

This PR splits the Explainer class into a Base and Explainer.
The Base class currently implements a structured approach to handle metadata (to be extended). This split allows us to introduce other base classes for new packages that do not conform to the Explainer interface. For example, algorithms for prototype selection are not explainers. Calling the explain method when, in fact, they are summarizing/distilling the dataset is not appropriate. Furthermore, functionalities such as saving and loading might expect other arguments, and resetting the prediction might not apply.

Possible to be used for the confidence package too.

Observation. The functionality of the Explanation class is already quite general and works for all packages. Changing the name to something more general would involve a lot of refactoring, which we don’t want to do, at least for now.

@RobertSamoilescu RobertSamoilescu requested review from jklaise and mauicv May 3, 2022 16:38
@codecov
Copy link

codecov bot commented May 3, 2022

Codecov Report

Merging #649 (f591958) into master (41db95e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head f591958 differs from pull request most recent head 9671d35. Consider uploading reports for the commit 9671d35 to get more accurate results

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #649   +/-   ##
=======================================
  Coverage   80.45%   80.46%           
=======================================
  Files          77       77           
  Lines       10634    10635    +1     
=======================================
+ Hits         8556     8557    +1     
  Misses       2078     2078           
Impacted Files Coverage Δ
alibi/api/interfaces.py 90.58% <100.00%> (+0.11%) ⬆️

Base class for all `alibi` algorithms. Implements a structured approach to handle metadata.
"""

meta: dict = attr.ib(default=attr.Factory(default_meta), repr=alibi_pformat) #: Explainer meta-data.
Copy link
Contributor

Choose a reason for hiding this comment

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

Explainer -> Object / Algorithm?

@RobertSamoilescu RobertSamoilescu merged commit a3d9023 into SeldonIO:master May 4, 2022
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.

2 participants