From 4e6062b23b53582b173572af3d60c8bc3fb34ec7 Mon Sep 17 00:00:00 2001 From: Chandan Singh Date: Thu, 18 Jul 2019 06:03:37 -0700 Subject: [PATCH] notes on pip installation --- notebooks/1_model_based.ipynb | 12 ++++++------ readme.md | 14 +++++++++----- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/notebooks/1_model_based.ipynb b/notebooks/1_model_based.ipynb index 575d9c4e..75b8a922 100644 --- a/notebooks/1_model_based.ipynb +++ b/notebooks/1_model_based.ipynb @@ -92,7 +92,7 @@ "metadata": {}, "outputs": [], "source": [ - "sys.path.append('models/slim')\n", + "sys.path.append('../imodels/slim')\n", "from SLIM import SLIM" ] }, @@ -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", @@ -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/')" ] }, { @@ -447,5 +447,5 @@ } }, "nbformat": 4, - "nbformat_minor": 2 + "nbformat_minor": 4 } diff --git a/readme.md b/readme.md index bb461d52..f6fcdd5a 100644 --- a/readme.md +++ b/readme.md @@ -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) @@ -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