-
-
Notifications
You must be signed in to change notification settings - Fork 379
[GSK-1504] Integration with W&B #1288
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GSK-1505 Exploring the tool
|
#1294) * Added new method to the Dataset class to log dataset to the WandB run. * updated to_wandb --------- Co-authored-by: Rabah Abdul Khalek <[email protected]>
…into GSK-1505-wandb
* Added new method to the TestSuiteResult class to log its execution results to the WandB run. * Resolved issues. * refactoring _parse_test_name --------- Co-authored-by: Rabah Abdul Khalek <[email protected]>
* Initial commit with the implementation of the SHAP explanation graphs logging to the WandB run. * Changed logic of obtaining feature names and types. * Removed redundant 'model.prepare_dataframe'. Small refactoring. * Added sorting of logged dataset, test suite result and scan result to distinct panels. * Moved 'explain' function below shap-related functions. * Code refactoring. * Changed naming for variables inside functions. * Removed explainer return, as it is not needed. * Moved 'prepare_df' to the separate utils.py file to avoid code duplication. * Added docstring to the '_get_cls_prediction_explanation' * Created dataclass ShapResult to store shap explanations there and encapsulate the logic of uploading SHAP charts to the WandB. * Refactoring of the 'background_example' function. * Refactoring. * Refactoring. * Changed enum class declaration. * Refactored model_explanation.py to be able to perform testing of explanation results equality. Added unit-tests for the SHAP logging to the WandB. * Small fix in comments. * Uncommented fixture. * Refactored "_get_highest_prob_shap" function. Made it more compact and self-explainable. * Removed #noqa options from the shap imports. Optimized imports. * Refactored _prepare_for_explanation function. Changed naming of the function output to highlight, that this data will be explained. * Renamed explain_full(one) to "_calculate_dataset(sample)_shap_values" * Refactored _get_background_example function. * Refactored 'explain_with_shap' function and 'ShapResult' dataclass for better handling classification models explanation. * Fixed bugs with unit-tests for wandb. * Transferred '_compare_explain_functions' to the 'test_model_explanation.py' * Refactoring. Renaming and functions replacement. * Renaming. * Transferred plotting functions from the shap_result.py to the wandb_utils.py to better handle wandb importing necessity. * small update to error msg * updated unit test * small update --------- Co-authored-by: Rabah Abdul Khalek <[email protected]>
andreybavt
suggested changes
Aug 25, 2023
Contributor
andreybavt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally speaking looks good to me, I left a few non-major comments
* Added docstrings to the "model_explanation.py". * Added docstrings to the "shap_result.py". * Fix in docstrings * Added docstring to the 'Dataset.to_wandb'. * Added docstring to the 'ScanResult.to_wandb'. * Added docstring to the 'TestSuiteResult.to_wandb'. * Resolved issues after PR review. * updated docstrings --------- Co-authored-by: Rabah Abdul Khalek <[email protected]>
andreybavt
approved these changes
Aug 30, 2023
Contributor
andreybavt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Kudos, SonarCloud Quality Gate passed! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.








Integration
Prerequisites
Features
Todo