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

Debug all tests #90

Merged
merged 13 commits into from
Dec 2, 2024
Merged

Debug all tests #90

merged 13 commits into from
Dec 2, 2024

Conversation

siqizhu-uk
Copy link
Contributor

@siqizhu-uk siqizhu-uk commented Nov 10, 2024

Description

Debug all tests(slow and not slow).

  • test_weighted_ensemble_explainer Failure
    • Issue: The test tests/plugins/ensemble/test_classifier.py::test_weighted_ensemble_explainer was failing due to a shape mismatch in the explain method's result from the KernelSHAPPlugin explainer for classification tasks.
    • Cause: In newer versions of shap (shap>=0.45.0), the shap_values implementation returns an ndarray with the shape (samples x features x output), which differs from the previous format (output x samples x features) for models with vector outputs.
    • Fix: Updated the output format of the explain method in src/autoprognosis/plugins/explainers/plugin_kernel_shap.py::KernelSHAPPlugin::explain to align with the new behavior for classification tasks.
  • test_surv_app Failure
    • Issue: The test tests/apps/test_survival_app.py::test_surv_app was failing due to a missing required parameter.
    • Fix: Added the "extras_cbk" parameter to NewRiskEstimationAppProto, setting its default value to None.

@DrShushen changes:

  • To fix pandas 1 --> 2 related AttributeError: 'DataFrame' object has no attribute 'append', in src/autoprognosis/plugins/explainers/plugin_risk_effect_size.py::RiskEffectSizePlugin._get_population_shifts a call to <dataframe>.append was replaced with pd.concat(), which should make this pandas 1 and 2 compatible.
  • To fix tests/plugins/uncertainty/test_cohort_explainer.py::test_fit/test_predict_classifier failing due to not getting any important features from "risk_effect_size" explainer, effect_size: float parameter added to CohortExplainerPlugin and set to a value lower value in the test.
  • Update actions/setup-python@v1 to v5 in GitHub workflows to avoid python setup errors.
  • Remove PR triggers for test_R workflow, as this is relatively low priority.
  • Add a score difference tolerance in test_surv_search test, to make the test more stable.

Affected Dependencies

  • force shap to be >= 0.45.0 to avoid shap_values return shape mismatch as mentioned in Description.

How has this been tested?

  • all tests in the tests directory

Checklist

@DrShushen DrShushen self-requested a review December 2, 2024 15:07
@DrShushen DrShushen self-assigned this Dec 2, 2024
@DrShushen
Copy link
Member

@siqizhu-uk - I've triggered the default PR test suite, let us see if they all run successfully

@DrShushen DrShushen added the maintenance Testing/maintenance task label Dec 2, 2024
@DrShushen
Copy link
Member

@siqizhu-uk great work, thank you! Will aim to fix the issues causing current GH workflow failures in the next PR

@DrShushen DrShushen merged commit 2c4ef7f into vanderschaarlab:main Dec 2, 2024
1 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Testing/maintenance task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants