Metadata-Version: 2.1
Name: NICEx
Version: 0.2.2
Summary: Nearest Instance Counterfactual explanations
Home-page: https://github.com/DBrughmans/NICE
Author: Dieter Brughmans
Author-email: dieter.brughmans@uantwerpen.be
License: Apache 2.0
Keywords: Counterfactual Explanations XAI
Platform: UNKNOWN
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: numpy (<2.0.0,>=1.16.2)
Requires-Dist: pandas (<2.0.0,>=0.23.3)

## Nearest Instance Counterfactual Explanations (NICE)

NICE is an algorithm to generate Counterfactual Explanations for heterogeneous tabular data. Our approach exploits 
information from a nearest instance to speed up the search process and guarantee that an explanation will be found.

### Installation

Install NICE through Pypi

```bash
pip install NICEx
```

or github

```bash
pip install git git+https://github.com/ADMantwerp/nice.git 
```

### Usage

NICE requires acces to the prediction score and trainingdata to generate counterfactual explanations.
```python
from nice import NICE

# Initialize NICE by specifing the optimization strategy
NICE_explainer = NICE(optimization='sparsity')
# Fit our NICE explainer on the training data and classifier
NICE_explainer.fit(predict_fn,X_train,cat_feat,num_feat,y_train,optimization='sparsity')
# explain an instance
NICE_explainer.explain(x)
```

### Examples
 [NICE on Adult](https://github.com/DBrughmans/NICE/blob/master/examples/NICE_adult.ipynb)
 
### References
[NICE: An Algorithm for Nearest Instance Counterfactual Explanations](https://arxiv.org/abs/2104.07411)


