Skip to content

Attributing model performance changes to distribution shifts in causal mechanisms.

License

Notifications You must be signed in to change notification settings

MLforHealth/expl_perf_drop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

"Why did the Model Fail?": Attributing Model Performance Changes to Distribution Shifts

A method to attribute model performance changes to distribution shifts in causal mechanisms. For more details please see our ICML 2023 paper.

Installation

Our package is available on PyPI. Simply run the following with Python >= 3.7:

pip install expl_perf_drop

Usage

We provide the following examples as Jupyter Notebooks:

  1. Spurious Synthetic Example
  2. More to come!

Reproducing the Paper

If reproducing the experiments in the paper, we recommend creating a separate Conda environment:

git clone https://github.com/MLforHealth/expl_perf_drop
cd expl_perf_drop/
conda env create -f environment.yml
conda activate expl_perf_drop

To reproduce the experiments in the paper which involve training grids of models and then generating explanations for them, use sweep.py as follows:

python -m expl_perf_drop.sweep launch \
    --experiment {experiment_name} \
    --output_dir {output_root} \
    --command_launcher {launcher} 

where:

  • experiment_name corresponds to experiments defined as classes in experiments.py
  • output_root is a directory where experimental results will be stored.
  • launcher is a string corresponding to a launcher defined in scripts/launchers.py (i.e. slurm or local).

The train_model experiment should be ran first. The remaining experiments can be ran in any order.

Alternatively, a single explanation can also be generated by calling explain.py with the appropriate arguments.

Acknowledgements

The CausalGAN portion of our CelebA experiment is heavily based on an experiment in the parametric-robustness-evaluation codebase. Our Shapley Value estimation functions are taken from the DoWhy package.

Citation

If you use this code or package in your research, please cite the following publication:

@inproceedings{zhang2023did,
  title={"Why did the Model Fail?": Attributing Model Performance Changes to Distribution Shifts},
  author={Zhang, Haoran and Singh, Harvineet and Ghassemi, Marzyeh and Joshi, Shalmali},
  booktitle={International Conference on Machine Learning},
  year={2023}
}

About

Attributing model performance changes to distribution shifts in causal mechanisms.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages