Skip to main content

INVASE: Instance-wise Variable Selection

Tests Downloads arXiv Test In Colab License: MIT

image

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

$ pip install invase

or from source, using

$ pip install .

:boom: Sample Usage

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

pip install .[testing]

The tests can be executed using

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},
}

Metadata

Release files for invase 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for invase 0.0.3
File Interpreter ABI Platform
invase-0.0.3-py3-none-macosx_10_14_x86_64.whl Python 3 none macOS 10.14+ x86-64 Details
invase-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 19.4 kB

Release files / invase-0.0.3-py3-none-macosx_10_14_x86_64.whl

Download URL invase-0.0.3-py3-none-macosx_10_14_x86_64.whl
Size 9.7 kB
Tags Python 3 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
725d68a7a59e5dc76ac05e131da45b88f5839ebd40341d8995e8199b613c1fd1
BLAKE2b-256 checksum
How to use checksums
6dc834442f64e90148a81fecb3e7e408f8e3f7bbbef579b2c1cc429b200d83ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.6

Release files / invase-0.0.3-py3-none-any.whl

Download URL invase-0.0.3-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
63deb5d5d615c90429d8060b084bcff59609de4e8974fd9be8565e38383e90f2
BLAKE2b-256 checksum
How to use checksums
2d31c01be532d0a5eeaf77c5fabb5fd2a9aadfd8eb5637b4c75db8f708c9e009
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page