Package: aix360
AI Explainability 360 (v0.3.0)The AI Explainability 360 toolkit is an open-source library that supports interpretability and explainability of datasets and machine learning models. The AI Explainability 360 Python package includes a comprehensive set of algorithms that cover different dimensions of explanations along with proxy explainability metrics. The AI Explainability 360 toolkit supports tabular, text, images, and time series data.TheAI Explainability 360 interactive experienceprovides a gentle introduction to the concepts and capabilities by walking through an example use case for different consumer personas. Thetutorials and example notebooksoffer a deeper, data scientist-oriented introduction. The complete API is also available.There is no single approach to explainability that works best. There are many ways to explain: data vs. model, directly interpretable vs. post hoc explanation, local vs. global, etc. It may therefore be confusing to figure out which algorithms are most appropriate for a given use case. To help, we have created someguidance materialand ataxonomy treethat can be consulted.We have developed the package with extensibility in mind. This library is still in development. We encourage you to contribute your explainability algorithms, metrics, and use cases. To get started as a contributor, please join theAI Explainability 360 Community on Slackby requesting an invitationhere. Please review the instructions to contribute code and python notebookshere.Supported explainability algorithmsData explanationsProtoDash (Gurumoorthy et al., 2019)Disentangled Inferred Prior VAE (Kumar et al., 2018)Local post-hoc explanationsProtoDash (Gurumoorthy et al., 2019)Contrastive Explanations Method (Dhurandhar et al., 2018)Contrastive Explanations Method with Monotonic Attribute Functions (Luss et al., 2019)Exemplar based Contrastive Explanations MethodGrouped Conditional Expectation (Adaptation of Individual Conditional Expectation Plots byGoldstein et al.to higher dimension )LIME (Ribeiro et al. 2016,Github)SHAP (Lundberg, et al. 2017,Github)Time-Series local post-hoc explanationsTime Series Saliency Maps using Integrated Gradients (Inspired bySundararajan et al.)Time Series LIME (Time series adaptation of the classic paper byRibeiro et al. 2016)Time Series Individual Conditional Expectation (Time series adaptation of Individual Conditional Expectation PlotsGoldstein et al.)Local direct explanationsTeaching AI to Explain its Decisions (Hind et al., 2019)Order Constraints in Optimal Transport (Lim et al.,2022,Github)Global direct explanationsInterpretable Model Differencing (IMD) (Haldar et al., 2023)CoFrNets (Continued Fraction Nets) (Puri et al., 2021)Boolean Decision Rules via Column Generation (Light Edition) (Dash et al., 2018)Generalized Linear Rule Models (Wei et al., 2019)Fast Effective Rule Induction (Ripper) (William W Cohen, 1995)Global post-hoc explanationsProfWeight (Dhurandhar et al., 2018)Supported explainability metricsFaithfulness (Alvarez-Melis and Jaakkola, 2018)Monotonicity (Luss et al., 2019)SetupSupported Configurations:Installation keywordExplainer(s)OSPython versioncofrnetcofrnetmacOS, Ubuntu, Windows3.10contrastivecem, cem_mafmacOS, Ubuntu, Windows3.6dipvaedipvaemacOS, Ubuntu, Windows3.10gcegcemacOS, Ubuntu, Windows3.10imdimdmacOS, Ubuntu3.10limelimemacOS, Ubuntu, Windows3.10matchingmatchingmacOS, Ubuntu, Windows3.10nncontrastivenncontrastivemacOS, Ubuntu, Windows3.10profwtprofwtmacOS, Ubuntu, Windows3.6protodashprotodashmacOS, Ubuntu, Windows3.10rbmbrcg, glrmmacOS, Ubuntu, Windows3.10rule_inductionrippermacOS, Ubuntu, Windows3.10shapshapmacOS, Ubuntu, Windows3.6tedtedmacOS, Ubuntu, Windows3.10tsicetsicemacOS, Ubuntu, Windows3.10tslimetslimemacOS, Ubuntu, Windows3.10tssaliencytssaliencymacOS, Ubuntu, Windows3.10(Optional) Create a virtual environmentAI Explainability 360 requires specific versions of many Python packages which may conflict
with other projects on your system. A virtual environment manager is strongly
recommended to ensure dependencies may be installed safely. If you have trouble installing the toolkit, try this first.CondaConda is recommended for all configurations though Virtualenv is generally
interchangeable for our purposes. Miniconda is sufficient (seethe difference between Anaconda and
Minicondaif you are curious) and can be installed fromhereif you do not already have it.Then, create a new python environment based on the explainability algorithms you wish to use by referring to thetableabove. For example, for python 3.10, use the following command:condacreate--nameaix360python=3.10
condaactivateaix360The shell should now look like(aix360) $. To deactivate the environment, run:(aix360)$condadeactivateThe prompt will return back to$or(base)$.Note: Older versions of conda may usesource activate aix360andsource deactivate(activate aix360anddeactivateon Windows).InstallationClone the latest version of this repository:(aix360)$gitclonehttps://github.com/Trusted-AI/AIX360If you'd like to run the examples and tutorial notebooks, download the datasets now and place them in
their respective folders as described inaix360/data/README.md.Then, navigate to the root directory of the project which containssetup.pyfile and run:(aix360)$pipinstall-e.[<algo1>,<algo2>,...]The above command installs packages required by specific algorithms. Here<algo>refers to the installation keyword intableabove. For instance to install packages needed by BRCG, DIPVAE, and TSICE algorithms, one could use(aix360)$pipinstall-e.[rbm,dipvae,tsice]The default commandpip install .installsdefault dependenciesalone.Note that you may not be able to install two algorithms that require different versions of python in the same environment (for instancecontrastivealong withrbm).If you face any issues, please try upgrading pip and setuptools and uninstall any previous versions of aix360 before attempting the above step again.(aix360)$pipinstall--upgradepipsetuptools(aix360)$pipuninstallaix360PIP Installation of AI Explainability 360If you would like to quickly start using the AI explainability 360 toolkit without explicitly cloning this repository, you can use one of these options:Install v0.3.0 via repository link(yourenvironment)$pipinstall-egit+https://github.com/Trusted-AI/AIX360.git#egg=aix360[<algo1>,<algo2>,...]For example, usepip install -e git+https://github.com/Trusted-AI/AIX360.git#egg=aix360[rbm,dipvae,tsice]to install BRCG, DIPVAE, and TSICE. You may need to installcmakeif its not already installed in your environment usingconda install cmake.Install previous version v0.2.1 viapypi(yourenvironment)$pipinstallaix360v0.2.1 includes fewer explainability algorithms. The pip installable package of v0.3.0 will be made available onpypisoon.If you follow either of these two options, you will need to download the notebooks available in theexamplesfolder separately.Dealing with installation errorsAI Explainability 360 toolkit istestedon Windows, MacOS, and Linux. However, if you still face installation issues due to package dependencies, please try installing the corresponding package via conda (e.g. conda install package-name) and then install the toolkit by following the usual steps. For example, if you face issues related to pygraphviz during installation, useconda install pygraphvizand then install the toolkit.Please use the right python environment based on thetableabove.Running in DockerUnderAIX360directory build the container image from Dockerfile usingdocker build -t aix360_docker .Start the container image using commanddocker run -it -p 8888:8888 aix360_docker:latest bashassuming port 8888 is free on your machine.Inside the container start jupuyter lab using commandjupyter lab --allow-root --ip 0.0.0.0 --port 8888 --no-browserAccess the sample tutorials on your machine using URLlocalhost:8888Using AI Explainability 360Theexamplesdirectory contains a diverse collection of jupyter notebooks
that use AI Explainability 360 in various ways. Both examples and tutorial notebooks illustrate
working code using the toolkit. Tutorials provide additional discussion that walks
the user through the various steps of the notebook. See the details about
tutorials and exampleshere.Citing AI Explainability 360If you are using AI Explainability 360 for your work, we encourage you toCite the followingpaper. The bibtex entry is as follows:@misc{aix360-sept-2019,
title = "One Explanation Does Not Fit All: A Toolkit and Taxonomy of AI Explainability Techniques",
author = {Vijay Arya and Rachel K. E. Bellamy and Pin-Yu Chen and Amit Dhurandhar and Michael Hind
and Samuel C. Hoffman and Stephanie Houde and Q. Vera Liao and Ronny Luss and Aleksandra Mojsilovi\'c
and Sami Mourad and Pablo Pedemonte and Ramya Raghavendra and John Richards and Prasanna Sattigeri
and Karthikeyan Shanmugam and Moninder Singh and Kush R. Varshney and Dennis Wei and Yunfeng Zhang},
month = sept,
year = {2019},
url = {https://arxiv.org/abs/1909.03012}
}Put a star on this repository.Share your success stories with us and others in theAI Explainability 360 Community.AIX360 VideosIntroductoryvideoto AI
Explainability 360 by Vijay Arya and Amit Dhurandhar, September 5, 2019 (35 mins)AcknowledgementsAIX360 is built with the help of several open source packages. All of these are listed in setup.py and some of these include:Tensorflowhttps://www.tensorflow.org/about/bibPytorchhttps://github.com/pytorch/pytorchscikit-learnhttps://scikit-learn.org/stable/about.htmlLicense InformationPlease view both theLICENSEfile and the foldersupplementary licensepresent in the root directory for license information.