|
1 | 1 |
|
2 | | -| |
3 | | -
|
4 | 2 | ======= |
5 | 3 | XAI-Lib |
6 | 4 | ======= |
7 | 5 |
|
| 6 | +.. image:: https://img.shields.io/pypi/v/XAI-Library.svg |
| 7 | + :target: https://pypi.org/project/XAI-Library/ |
| 8 | + :alt: PyPI version |
| 9 | + |
| 10 | +.. image:: https://img.shields.io/pypi/pyversions/XAI-Library.svg |
| 11 | + :target: https://pypi.org/project/XAI-Library/ |
| 12 | + :alt: Python versions |
| 13 | + |
| 14 | +.. image:: https://img.shields.io/github/license/kdd-lab/XAI-Lib.svg |
| 15 | + :target: https://github.com/kdd-lab/XAI-Lib/blob/main/LICENSE |
| 16 | + :alt: License |
8 | 17 |
|
9 | | -An integrated library for explanation methods. |
| 18 | +| |
| 19 | +
|
| 20 | +**XAI-Lib** is an integrated Python library for Explainable AI (XAI) that provides a unified interface for various explanation methods. Developed to make machine learning models more interpretable and transparent, XAI-Lib simplifies the process of explaining black-box models across different data types. |
10 | 21 |
|
11 | | -A python library to develop explaninable machine learning models. The library provides an integrated interface to setup and execute explanation methods for black boxes. |
| 22 | +This project is part of the `XAI Project <https://xai-project.eu/>`_ - a European initiative focused on advancing explainable artificial intelligence research and applications. |
12 | 23 |
|
13 | | -The library is designed to be modular and extensible. It provides a simple interface to add new explanation methods and integrate them with the existing ones. |
14 | | -The starting list of explanation methods includes: |
15 | | -* For tabular data: |
| 24 | +| |
16 | 25 |
|
17 | | - * SHAP |
18 | | - * LIME |
19 | | - * Anchors |
20 | | - * LORE |
| 26 | +✨ Features |
| 27 | +=========== |
21 | 28 |
|
22 | | -* For image data: |
| 29 | +**XAI-Lib** is designed to be **modular**, **extensible**, and **easy to use**. It provides: |
23 | 30 |
|
24 | | - * GradCAM |
25 | | - * LIME |
26 | | - * SHAP |
27 | | - * ABELE |
| 31 | +- 🔌 **Unified Interface**: Simple, consistent API for multiple explanation methods |
| 32 | +- 📊 **Multiple Data Types**: Support for tabular, image, text, and time-series data |
| 33 | +- 🧩 **Extensible Architecture**: Easy integration of new explanation methods |
| 34 | +- 🎯 **Model-Agnostic**: Works with any black-box machine learning model |
| 35 | +- 📚 **Well-Documented**: Comprehensive documentation and examples |
28 | 36 |
|
29 | | -* For text data: |
| 37 | +| |
30 | 38 |
|
31 | | - * still work-in-progress |
| 39 | +🛠️ Supported Explanation Methods |
| 40 | +================================== |
32 | 41 |
|
33 | | -* For time series data: |
| 42 | +Tabular Data |
| 43 | +------------ |
34 | 44 |
|
35 | | - * still work-in-progress |
| 45 | +* **SHAP** - SHapley Additive exPlanations |
| 46 | +* **LIME** - Local Interpretable Model-agnostic Explanations |
| 47 | +* **Anchors** - High-precision model-agnostic explanations |
| 48 | +* **LORE** - LOcal Rule-based Explanations |
36 | 49 |
|
| 50 | +Image Data |
| 51 | +---------- |
| 52 | + |
| 53 | +* **GradCAM** - Gradient-weighted Class Activation Mapping |
| 54 | +* **LIME** - Local Interpretable Model-agnostic Explanations |
| 55 | +* **SHAP** - SHapley Additive exPlanations |
| 56 | +* **ABELE** - Adversarial Black-box Explainer generating Latent Exemplars |
| 57 | + |
| 58 | +Text Data |
| 59 | +--------- |
| 60 | + |
| 61 | +* 🚧 **Work in Progress** - Coming soon! |
| 62 | + |
| 63 | +Time Series Data |
| 64 | +---------------- |
| 65 | + |
| 66 | +* 🚧 **Work in Progress** - Coming soon! |
| 67 | + |
| 68 | +| |
37 | 69 |
|
38 | | -Getting Started |
| 70 | +📦 Installation |
39 | 71 | =============== |
40 | | -The library can be installed using pip or by cloning the repository. |
41 | 72 |
|
42 | | -To install the library using pip, run the following command: |
| 73 | +Install from PyPI |
| 74 | +----------------- |
| 75 | + |
| 76 | +The easiest way to install **XAI-Lib** is using pip: |
43 | 77 |
|
44 | 78 | .. code-block:: bash |
45 | 79 |
|
46 | 80 | pip install XAI-Library |
47 | 81 |
|
| 82 | +Install from Source |
| 83 | +------------------- |
| 84 | + |
| 85 | +For the latest development version, clone the repository and install in editable mode: |
| 86 | + |
| 87 | +.. code-block:: bash |
| 88 | +
|
| 89 | + git clone https://github.com/kdd-lab/XAI-Lib.git |
| 90 | + cd XAI-Lib |
| 91 | + pip install -e . |
48 | 92 |
|
49 | | -To have access to the latest version of the library, clone the repository and create a virtual environment. Then install the library using the following command: |
| 93 | +**Recommended**: Use a virtual environment to avoid dependency conflicts: |
50 | 94 |
|
51 | 95 | .. code-block:: bash |
52 | 96 |
|
53 | | - virtualenv venv |
54 | | - source venv/bin/activate |
55 | | - pip install -e . |
| 97 | + # Create and activate virtual environment |
| 98 | + python -m venv venv |
| 99 | + source venv/bin/activate # On Windows: venv\Scripts\activate |
| 100 | + |
| 101 | + # Install XAI-Lib |
| 102 | + pip install -e . |
| 103 | +
|
| 104 | +| |
| 105 | +
|
| 106 | +🚀 Quick Start |
| 107 | +============== |
| 108 | + |
| 109 | +Here's a simple example of using LIME for tabular data explanation: |
| 110 | + |
| 111 | +.. code-block:: python |
| 112 | +
|
| 113 | + from xailib import Explainer |
| 114 | + |
| 115 | + # Initialize your black-box model |
| 116 | + # model = YourModel() |
| 117 | + |
| 118 | + # Create an explainer |
| 119 | + explainer = Explainer(model, method='lime') |
| 120 | + |
| 121 | + # Generate explanation for a sample |
| 122 | + explanation = explainer.explain(sample_data) |
| 123 | + |
| 124 | + # Visualize the explanation |
| 125 | + explainer.visualize(explanation) |
| 126 | +
|
| 127 | +For more examples and detailed usage, please check the `examples/ <https://github.com/kdd-lab/XAI-Lib/tree/main/examples>`_ directory. |
| 128 | + |
| 129 | +| |
| 130 | +
|
| 131 | +📖 Documentation |
| 132 | +================ |
| 133 | + |
| 134 | +For detailed documentation, tutorials, and API reference, visit: |
| 135 | + |
| 136 | +* **Documentation**: `https://xai-lib.readthedocs.io/ <https://xai-lib.readthedocs.io/>`_ |
| 137 | +* **GitHub Repository**: `https://github.com/kdd-lab/XAI-Lib <https://github.com/kdd-lab/XAI-Lib>`_ |
| 138 | +* **Issue Tracker**: `https://github.com/kdd-lab/XAI-Lib/issues <https://github.com/kdd-lab/XAI-Lib/issues>`_ |
| 139 | + |
| 140 | +| |
| 141 | +
|
| 142 | +🤝 Contributing |
| 143 | +=============== |
| 144 | + |
| 145 | +We welcome contributions! Please see our `Contributing Guide <CONTRIBUTING.rst>`_ for details on how to: |
| 146 | + |
| 147 | +* Report bugs and request features |
| 148 | +* Submit pull requests |
| 149 | +* Improve documentation |
| 150 | +* Add new explanation methods |
| 151 | + |
| 152 | +| |
| 153 | +
|
| 154 | +👥 Authors & Contributors |
| 155 | +========================== |
| 156 | + |
| 157 | +See `AUTHORS.rst <AUTHORS.rst>`_ for a complete list of contributors to this project. |
| 158 | + |
| 159 | +| |
| 160 | +
|
| 161 | +📄 License |
| 162 | +========== |
| 163 | + |
| 164 | +This project is licensed under the MIT License - see the `LICENSE <LICENSE.txt>`_ file for details. |
| 165 | + |
| 166 | +| |
| 167 | +
|
| 168 | +🙏 Acknowledgments |
| 169 | +================== |
| 170 | + |
| 171 | +This library is developed as part of the **XAI Project** (`https://xai-project.eu/ <https://xai-project.eu/>`_), a European initiative dedicated to advancing explainable artificial intelligence. |
| 172 | + |
| 173 | +The XAI Project aims to: |
| 174 | + |
| 175 | +* Develop new methods for explainable AI |
| 176 | +* Create practical tools for AI transparency |
| 177 | +* Foster collaboration between research and industry |
| 178 | +* Promote responsible AI development |
| 179 | + |
| 180 | +For more information about the XAI Project, visit `https://xai-project.eu/ <https://xai-project.eu/>`_. |
| 181 | + |
| 182 | +| |
| 183 | +
|
| 184 | +📧 Contact |
| 185 | +========== |
| 186 | + |
| 187 | +For questions and support: |
| 188 | + |
| 189 | +* **Email**: rinzivillo@isti.cnr.it |
| 190 | +* **Issue Tracker**: `https://github.com/kdd-lab/XAI-Lib/issues <https://github.com/kdd-lab/XAI-Lib/issues>`_ |
| 191 | + |
56 | 192 |
|
57 | 193 |
|
0 commit comments