Skip to content

Commit 70b89ad

Browse files
authored
Merge pull request #20 from AryaXAI/image_metrics_03022025
Added Batchwise Metric Calculation ; Cache Batchwise Metric Storage; Bug Fixes; Tqdm
2 parents 91af693 + abc9f79 commit 70b89ad

File tree

5 files changed

+229
-184
lines changed

5 files changed

+229
-184
lines changed

README.md

+2-33
Original file line numberDiff line numberDiff line change
@@ -31,40 +31,9 @@
3131
To install **`xai_evals`**, you can use `pip`. First, clone the repository or download the files to your local environment. Then, install the necessary dependencies:
3232

3333
```bash
34-
git clone https://github.com/AryaXAI/xai_evals.git
35-
cd xai_evals
36-
pip install .
34+
pip install xai_evals
3735
```
3836

39-
Alternatively, if you don't want to clone the repo manually, you can install the package directly from pip (after we publish it [TODO]).
40-
41-
### Dependencies
42-
43-
- **`dl_backtrace`**: A library for analyzing neural networks by tracing the relevance of each component from output to input.
44-
- **`shap==0.46.0`**: A library for computing SHAP values (SHapley Additive exPlanations) to interpret machine learning models.
45-
- **`lime==0.2.0.1`**: A library for generating LIME (Local Interpretable Model-Agnostic Explanations) to explain individual predictions.
46-
- **`xgboost==2.1.3`**: A gradient boosting library designed for efficient and scalable machine learning tasks.
47-
- **`scikit-learn==1.3.2`**: A versatile machine learning library for building and evaluating models, and performing preprocessing.
48-
- **`torch`**: A deep learning framework (PyTorch) for creating and training neural networks.
49-
- **`pandas==2.1.4`**: A powerful library for data manipulation and analysis, particularly useful for handling tabular data.
50-
- **`numpy==1.26.4`**: A fundamental library for numerical computations, providing support for large, multi-dimensional arrays and matrices.
51-
- **`catboost==1.2.7`**: A gradient boosting library that is particularly effective for categorical feature handling.
52-
- **`lightgbm==4.5.0`**: A fast, distributed, high-performance gradient boosting framework for machine learning.
53-
- **`tensorflow==2.14.0`**: An open-source library for machine learning and deep learning tasks, developed by Google.
54-
- **`captum==0.7.0`**: A model interpretability library for PyTorch, offering various attribution methods.
55-
- **`tf-explain`**: A library for interpreting deep learning models, particularly for TensorFlow/Keras-based models.
56-
- **`quantus`**: A library for evaluating model explanations using various quantitative metrics.
57-
58-
This list ensures all required dependencies, with specific versions, are included for optimal compatibility.
59-
60-
To install all dependencies, run:
61-
62-
```bash
63-
pip install -r requirements.txt
64-
```
65-
66-
---
67-
6837
## Usage
6938

7039
Supported Machine Learning Models for `SHAPExplainer` and `LIMEExplainer` class is as follows :
@@ -969,7 +938,7 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file
969938

970939
### Future Plans
971940

972-
In the future, we will continue to improve this library by:
941+
In the future, we will continue to improve this library.
973942

974943

975944

requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ catboost==1.2.7
99
lightgbm==4.5.0
1010
tensorflow==2.14.0
1111
captum==0.7.0
12+
quantus==0.5.3
1213
tf-explain
13-
quantus
1414
torch
15+
tqdm

xai_evals/explainer.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# shap_lime_explainer/explainer.py
21
import shap
32
import lime.lime_tabular
43
import numpy as np
@@ -958,4 +957,4 @@ def _format_relevance(self, instance, relevance):
958957

959958
# Sort by relevance to understand the most influential features
960959
relevance_df = relevance_df.sort_values(by="Attribution", key=abs, ascending=False)
961-
return relevance_df
960+
return relevance_df

0 commit comments

Comments
 (0)