fastshapv1-0.0.10
توضیحات
A shap wrapper for fastai
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | fastshapv1-0.0.10 |
| نام | fastshapv1 |
| نسخه کتابخانه | 0.0.10 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Zach Mueller |
| ایمیل نویسنده | muellerzr@gmail.com |
| آدرس صفحه اصلی | https://github.com/muellerzr/fastshapv1 |
| آدرس اینترنتی | https://pypi.org/project/fastshapv1/ |
| مجوز | Apache Software License 2.0 |
# FastSHAP (V1)
> This project brings in part of the `SHAP` library into `fastai` (V1) and make it compatible. Thank you to Nestor Demeure for his assistance with the project!
## Install
`pip install fastshap`
## How to use
First we'll quickly train a `ADULTS` tabular model
```
from fastai2.tabular.all import *
```
```
path = untar_data(URLs.ADULT_SAMPLE)
df = pd.read_csv(path/'adult.csv')
```
```
dep_var = 'salary'
cat_names = ['workclass', 'education', 'marital-status', 'occupation', 'relationship', 'race']
cont_names = ['age', 'fnlwgt', 'education-num']
procs = [Categorify, FillMissing, Normalize]
```
```
splits = IndexSplitter(list(range(800,1000)))(range_of(df))
to = TabularPandas(df, procs, cat_names, cont_names, y_names="salary", splits=splits)
dls = to.dataloaders()
```
```
learn = tabular_learner(dls, layers=[200,100], metrics=accuracy)
learn.fit(1, 1e-2)
```
And now for some example usage!
```
from fastshap.interp import *
```
```
exp = ShapInterpretation(learn, df.iloc[:100])
```
```
exp.dependence_plot('age')
```
Classification model detected, displaying score for the class <50k.
(use `class_id` to specify another class)

For more examples see [01_Interpret](https://muellerzr.github.io/fastshap//interpret)
*For more unofficial fastai extensions, see the [Fastai Extensions Repository](https://github.com/nestordemeure/fastai-extensions-repository).*
نیازمندی
| مقدار | نام |
|---|---|
| - | fastai |
| - | fastcore |
| - | shap |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.6 | Python |
نحوه نصب
نصب پکیج whl fastshapv1-0.0.10:
pip install fastshapv1-0.0.10.whl
نصب پکیج tar.gz fastshapv1-0.0.10:
pip install fastshapv1-0.0.10.tar.gz