https://github.com/vanderschaarlab/invase
INVASE: Instance-wise Variable Selection . For more details, read the paper "INVASE: Instance-wise Variable Selection using Neural Networks," International Conference on Learning Representations (ICLR), 2019.
https://github.com/vanderschaarlab/invase
interpretability machine-learning machine-learning-algorithms machine-learning-interpretability pytorch xai
Last synced: 12 months ago
JSON representation
INVASE: Instance-wise Variable Selection . For more details, read the paper "INVASE: Instance-wise Variable Selection using Neural Networks," International Conference on Learning Representations (ICLR), 2019.
- Host: GitHub
- URL: https://github.com/vanderschaarlab/invase
- Owner: vanderschaarlab
- License: mit
- Created: 2022-08-30T14:56:34.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-30T16:35:50.000Z (over 3 years ago)
- Last Synced: 2025-04-05T07:23:04.036Z (about 1 year ago)
- Topics: interpretability, machine-learning, machine-learning-algorithms, machine-learning-interpretability, pytorch, xai
- Language: Python
- Homepage:
- Size: 110 KB
- Stars: 5
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.rst
- License: LICENSE
Awesome Lists containing this project
README
# INVASE: Instance-wise Variable Selection
[](https://github.com/vanderschaarlab/INVASE/actions/workflows/test.yml)
[](https://pypi.org/project/invase/)
[](https://openreview.net/pdf?id=BJg_roAcK7)
[](https://colab.research.google.com/drive/11PZ6gk46lprhoDR30ZCpdLVB7WNn3pFj?usp=sharing)
[](https://opensource.org/licenses/MIT)

Authors: Jinsung Yoon, James Jordon, Mihaela van der Schaar
Paper: Jinsung Yoon, James Jordon, Mihaela van der Schaar, "IINVASE: Instance-wise Variable Selection using Neural Networks," International Conference on Learning Representations (ICLR), 2019. (https://openreview.net/forum?id=BJg_roAcK7)
## :rocket: Installation
The library can be installed from PyPI using
```bash
$ pip install invase
```
or from source, using
```bash
$ pip install .
```
## :boom: Sample Usage
```python
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
from invase import INVASE
X, y = load_iris(return_X_y=True, as_frame = True)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
## Load the model
model = LogisticRegression()
model.fit(X_train, y_train)
## Load INVASE
explainer = INVASE(
model,
X_train,
y_train,
n_epoch=1000,
prefit = True, # the model is already trained
)
## Explain
explainer.explain(X_test.head(5))
```
## :hammer: Tests
Install the testing dependencies using
```bash
pip install .[testing]
```
The tests can be executed using
```bash
pytest -vsx
```
## Citing
If you use this code, please cite the associated paper:
```
@inproceedings{
yoon2018invase,
title={{INVASE}: Instance-wise Variable Selection using Neural Networks},
author={Jinsung Yoon and James Jordon and Mihaela van der Schaar},
booktitle={International Conference on Learning Representations},
year={2019},
url={https://openreview.net/forum?id=BJg_roAcK7},
}
```