跳转到主要内容

INVASE:实例变量选择

项目描述

INVASE:实例变量选择

Tests Downloads arXiv Test In Colab License: MIT

image

作者:Jinsung Yoon, James Jordon, Mihaela van der Schaar

论文:Jinsung Yoon, James Jordon, Mihaela van der Schaar, "IINVASE: Instance-wise Variable Selection using Neural Networks," 国际学习表示会议 (ICLR), 2019. (https://openreview.net/forum?id=BJg_roAcK7)

:rocket: 安装

可以使用以下方式从PyPI安装库

$ pip install invase

或者从源码安装,使用

$ pip install .

:boom: 示例用法

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: 测试

使用以下命令安装测试依赖项

pip install .[testing]

可以使用以下命令执行测试

pytest -vsx

引用

如果您使用此代码,请引用相关论文

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

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定要选择哪个,请了解更多关于安装包的信息。

源代码分发

本版本没有提供源分发文件。请参阅有关生成分发归档的教程。

构建的分发

invase-0.0.3-py3-none-macosx_10_14_x86_64.whl (9.7 kB 查看哈希值)

上传于 Python 3 macOS 10.14+ x86-64

invase-0.0.3-py3-none-any.whl (9.7 kB 查看哈希值)

上传于 Python 3

支持