Commit cb2a75a
[GSK-1504] Integration with W&B (#1288)
* added wandb run contextmanager
* added to_wandb for scan results
* Added new method to the Dataset class to log dataset to the WandB run. (#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]>
* setting up the doc skeleton
* updated pyproject and pdm lock with wandb
* working on tests
* GSK-1531 (#1301)
* 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]>
* functional tests implemented (GSK-1535)
* fixed code smell
* updated docs
* updated imports
* GSK-1533 (#1307)
* 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]>
* added errors and telemetry
* fixing code smells
* fixed indent
* turned off validation of Dataset in model_explanation
* exposed explain_with_shap
* converted error to warning
* updated tests
* restored fixtures
* New example notebook to show WandB integration functionality.
* WandB notebook refactoring. Committing images.
* Removed blank cell.
* Removed blank cell.
* updated docs
* Replaced screenshots with the giskard scan result.
* Fixed 'explain_with_shap' issue, when the model is the LGBM.
* Updated screenshot with test-suite results comparison for multiple runs.
* updated pdm lock
* implementing AA's feedback
* GSK-1565 (#1339)
* 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]>
---------
Co-authored-by: AbSsEnT <[email protected]>
Co-authored-by: Andrey Avtomonov <[email protected]>1 parent 8f69e0f commit cb2a75a
22 files changed
Lines changed: 4520 additions & 3185 deletions
File tree
- python-client
- docs
- assets/integrations/wandb
- integrations
- wandb
- giskard
- core
- datasets/base
- integrations/wandb
- models
- scanner
- tests
- integrations
- models
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
21 | 29 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
Lines changed: 118 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
0 commit comments