Skip to content

Fix/pd variance plot test coverage #820

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

Conversation

RobertSamoilescu
Copy link
Collaborator

This PR includes tests for the potting functionality of the PartialDependenceVariance explainer to increase coverage (i.e. addresses #760 ).

@codecov
Copy link

codecov bot commented Nov 11, 2022

Codecov Report

Merging #820 (3fd0a40) into master (1ba9ead) will increase coverage by 4.67%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #820      +/-   ##
==========================================
+ Coverage   76.37%   81.05%   +4.67%     
==========================================
  Files          73       73              
  Lines        8477     8475       -2     
==========================================
+ Hits         6474     6869     +395     
+ Misses       2003     1606     -397     
Flag Coverage Δ
macos-latest-3.10 81.01% <100.00%> (+4.67%) ⬆️
ubuntu-latest-3.10 80.92% <100.00%> (+4.58%) ⬆️
ubuntu-latest-3.7 80.89% <100.00%> (+4.70%) ⬆️
ubuntu-latest-3.8 80.93% <100.00%> (+4.69%) ⬆️
ubuntu-latest-3.9 80.93% <100.00%> (+4.69%) ⬆️
windows-latest-3.9 78.50% <100.00%> (+4.60%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
alibi/explainers/pd_variance.py 98.78% <100.00%> (+58.05%) ⬆️
alibi/datasets/default.py 93.47% <0.00%> (+23.91%) ⬆️
alibi/utils/visualization.py 48.10% <0.00%> (+29.11%) ⬆️
alibi/explainers/partial_dependence.py 84.66% <0.00%> (+36.50%) ⬆️
alibi/datasets/tensorflow.py 100.00% <0.00%> (+50.00%) ⬆️


@pytest.mark.parametrize('n_axes', [4, 5, 6, 7])
@pytest.mark.parametrize('n_cols', [2, 3, 4])
@pytest.mark.parametrize('exp', [lazy_fixture('explanation_importance')])
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why this needs to be a lazy fixture since it doesn't have it any parameters, can't test functions just depend on this fixture directly as usual?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes ... I think initially I intended to use both types of explanations in the test ... I will update it.

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.

LGTM! Just not sure we need to use lazy_fixture at all.

@jklaise jklaise merged commit 65e65f3 into SeldonIO:master Nov 18, 2022
RobertSamoilescu added a commit to RobertSamoilescu/alibi that referenced this pull request Jan 4, 2023
* Fixed minor bug for conditional plots.

* Included importance explanation fixture.

* Included interaction explanation fixture.

* Included test for hbar ncols. Solved flake8 issues.

* Included value error ax for hbar plot.

* Included interaction plot tests.

* Included plot_pd_variance tests.

* Updated the explanation objects with random values. Fixed test that failed before because of simple explanation values.

* More random values.

* Removed lazy fixture.
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