Skip to content

Commit

Permalink
notes on pip installation
Browse files Browse the repository at this point in the history
  • Loading branch information
csinva committed Jul 18, 2019
1 parent d4b0d49 commit 4e6062b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
12 changes: 6 additions & 6 deletions notebooks/1_model_based.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"metadata": {},
"outputs": [],
"source": [
"sys.path.append('models/slim')\n",
"sys.path.append('../imodels/slim')\n",
"from SLIM import SLIM"
]
},
Expand Down Expand Up @@ -292,8 +292,8 @@
"metadata": {},
"outputs": [],
"source": [
"sys.path.append('models/bayesian_rule_lists')\n",
"sys.path.append('models/bayesian_rule_lists/discretization')\n",
"sys.path.append('../imodels/bayesian_rule_lists')\n",
"sys.path.append('../imodels/bayesian_rule_lists/discretization')\n",
"from RuleListClassifier import *\n",
"from sklearn.datasets import fetch_openml\n",
"from sklearn.model_selection import train_test_split\n",
Expand Down Expand Up @@ -357,8 +357,8 @@
"metadata": {},
"outputs": [],
"source": [
"sys.path.append('models/optimal_classification_tree/pyoptree')\n",
"sys.path.append('models/optimal_classification_tree/')"
"sys.path.append('../imodels/optimal_classification_tree/pyoptree')\n",
"sys.path.append('../imodels/optimal_classification_tree/')"
]
},
{
Expand Down Expand Up @@ -447,5 +447,5 @@
}
},
"nbformat": 4,
"nbformat_minor": 2
"nbformat_minor": 4
}
14 changes: 9 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

Code for implementations of interpretable machine learning models and demos of how to use various interpretability techniques (with accompanying slides [here](https://docs.google.com/presentation/d/1RIdbV279r20marRrN0b1bu2z9STkrivsMDa_Dauk8kE/present)).


### Code implementations
Provides scikit-learn style wrappers/implementations of different interpretable models (see readmes in individual folders within [models](models) for details)
Provides scikit-learn style wrappers/implementations of different interpretable models (see readmes in individual folders within [imodels](imodels) for details)

- [bayesian rule lists](https://arxiv.org/abs/1602.08610)
- [optimal classification tree](https://link.springer.com/article/10.1007/s10994-017-5633-9)
Expand All @@ -18,12 +17,17 @@ The demos are contained in 3 main [notebooks](notebooks), summarized in [cheat_s
3. [uncertainty.ipynb](notebooks/uncertainty.ipynb) - code to get uncertainty estimates for a model

### Installation / quickstart
To install, `pip install git+https://github.com/csinva/interpretability-implementations-demos`
The interpretable models within the [imodels](imodels) folder can be easily installed and used.

```
`pip install git+https://github.com/csinva/interpretability-implementations-demos`

```

from imodels.bayesian_rule_lists import RuleListClassifier
model = RuleListClassifier()
model.fit(X_train, y_train)
model.score(X_test, y_test)
preds = model.predict(X_test)
```

### References / further reading

Expand Down

0 comments on commit 4e6062b

Please sign in to comment.