Module epiclass.utils.shap.benchmark_shap
Benchmarking SHAP value computation functions.
Functions
def benchmark(metadata: Metadata, datasource: EpiDataSource, model)
-
Benchmark the time taken for computing SHAP values based on the size of the background dataset.
Args
metadata
:Metadata
- A Metadata object containing dataset metadata.
datasource
:EpiDataSource
- An EpiDataSource object for accessing the data.
model
- The model used for computing SHAP values.
def test_background_effect(my_metadata: Metadata, my_datasource: EpiDataSource, my_model, logdir: pathlib.Path)
-
Test the effect of different background datasets on SHAP value computation.
Args
my_metadata
:Metadata
- A Metadata object containing dataset metadata.
my_datasource
:EpiDataSource
- An EpiDataSource object for accessing the data.
my_model
- The model used for computing SHAP values.
logdir
:Path
- The path to the output log directory.