Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ALE custom grid points update. #731

Merged
merged 3 commits into from
Aug 5, 2022

Conversation

RobertSamoilescu
Copy link
Collaborator

@RobertSamoilescu RobertSamoilescu commented Aug 1, 2022

Changes behavior from:

Grid points outside the feature range. Consider the following example: `O O O X X O X O X O O`, \
where 3 grid-points are smaller than the minimum value in `f`, and 2 grid-points are larger than the maximum \
value in `f`. Grid-points outside the feature value range are clipped between the minimum and maximum \
values of `f`. The grid-points considered will be: `(O|X) X O X O (X|O)`.

to:

Grid points outside the feature range. Consider the following example: `O O O X X O X O X O O`, \
where 3 grid-points are smaller than the minimum value in `f`, and 2 grid-points are larger than the maximum \
value in `f`. The empty leading and ending bins are removed. The grid-points considered
will be: `O X X O X O X O`.

Note that the new approach is less strict in terms of the lower & upper bound of the grid. This further allows
custom lower/upper grid values to be considered (previously the grid points were clamped to the min/max feature values) for which the ALE is still well defined.

The PR also includes a stress test for custom grid points.

@codecov
Copy link

codecov bot commented Aug 1, 2022

Codecov Report

Merging #731 (1f89be4) into master (dc55aba) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #731      +/-   ##
==========================================
+ Coverage   81.06%   81.12%   +0.05%     
==========================================
  Files         105      105              
  Lines       11794    11828      +34     
==========================================
+ Hits         9561     9595      +34     
  Misses       2233     2233              
Impacted Files Coverage Δ
alibi/explainers/ale.py 65.65% <100.00%> (+1.07%) ⬆️
alibi/explainers/tests/test_ale.py 100.00% <100.00%> (ø)

Copy link
Contributor

@jklaise jklaise left a comment

Choose a reason for hiding this comment

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

Nice!

@@ -138,8 +139,8 @@ def explain(self,

- Grid points outside the feature range. Consider the following example: `O O O X X O X O X O O`, \
where 3 grid-points are smaller than the minimum value in `f`, and 2 grid-points are larger than the maximum \
value in `f`. Grid-points outside the feature value range are clipped between the minimum and maximum \
values of `f`. The grid-points considered will be: `(O|X) X O X O (X|O)`.
value in `f`. The empty leading and ending bins were removed. The grid-points considered
Copy link
Contributor

Choose a reason for hiding this comment

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

were -> are

@RobertSamoilescu RobertSamoilescu merged commit 5db36d9 into SeldonIO:master Aug 5, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants