Skip to content

Commit 70db005

Browse files
authored
Merge pull request #14 from explainX/what-if
What if
2 parents fb2deb5 + 97e0e0c commit 70db005

33 files changed

+2213
-719
lines changed

README.md

Lines changed: 113 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
<h1 align="center">
2-
<img width="700" src="main_page_banner.png" alt="explainX.ai">
2+
<img width="300" src="https://i.ibb.co/yY7tfDg/Logo.jpg" alt="explainX.ai">
33
<br>
44
</h1>
55

66
<p align="center">
77
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.6%20|%203.7|%203.8-brightgreen.svg" alt="Python supported"></a>
88
<!-- <a href="https://pypi.org/project/explainx/"><img src="https://badge.fury.io/py/explainx.svg" alt="PyPi Version"></a> -->
99
<!-- <a href="https://pypi.org/project/explainx/"><img src="https://img.shields.io/pypi/dm/explainx" alt="PyPi Downloads"></a> -->
10-
<a href="https://www.explainx.ai/"> <img src="https://img.shields.io/website?url=https%3A%2F%2Fwww.explainx.ai%2F" alt="explainx.ai website"></a>
10+
<a href="https://www.explainx.ai/"><img src="https://img.shields.io/website?url=https%3A%2F%2Fwww.explainx.ai%2F" alt="explainx.ai website"></a>
1111
</p>
1212

13-
ExplainX.ai is a fast, scalable and end-to-end Explainable AI framework for data scientists & machine learning engineers.
1413

15-
With explainX, you can understand overall model behavior, get the reasoning behind model predictions, remove biases and create convincing explanations for your business stakeholders. [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Explain%20any%20black-box%20Machine%20Learning%20model%20in%20just%20one%20line%20of%20code%21&url=https://www.explainx.ai&hashtags=xai,explainable_ai,explainable_machine_learning,trust_in_ai,transparent_ai)
14+
ExplainX.ai is a fast, light-weight and scalable Explainable AI framework for data scientists. It enables you to explain and debug state of the art machine learning models in as simple as one line of code. [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Explain%20any%20black-box%20Machine%20Learning%20model%20in%20just%20one%20line%20of%20code%21&url=https://www.explainx.ai&hashtags=xai,explainable_ai,explainable_machine_learning,trust_in_ai,transparent_ai)
1615

17-
<img width="800" src="started_example.png" alt="explainX.ai">
16+
<img width="600" src="https://i.ibb.co/w4SF1GJ/Group-2-1.png" alt="explainX.ai">
17+
18+
![Demo](demo.gif)
1819

1920
#### Why we need explainability & interpretibility?
2021

@@ -25,96 +26,158 @@ Essential for:
2526
4. Regulatory compliance - Does my model satisfy legal & regulatory requirements?
2627
5. High-risk applications - Healthcare, Financial Services, FinTech, Judicial, Security etc,.
2728

28-
Visit our website to learn more: https://www.explainx.ai
29+
Visit explainx.ai website to learn more: https://www.explainx.ai
30+
31+
2932

3033
## Try it out
3134

32-
* [Installing explainX](https://docs.explainx.ai/getting-started/installation)
33-
* [Working Examples](https://docs.explainx.ai/getting-started/starter-example)
34-
* [explainX Dashboard Features](https://docs.explainx.ai/tutorials/analyzing-dashboard)
35-
* [Documentation](https://docs.explainx.ai/)
36-
* [Help Us Improve explainX.ai](https://forms.gle/5Q1xaHd7s6UQkRzf8)
35+
* [Installing explainX](https://explainx-documentation.netlify.app/)
36+
* [Working Examples](https://explainx-documentation.netlify.app/working-example/)
37+
* [explainX Dashboard Features](https://explainx-documentation.netlify.app/analyze-dashboard/)
38+
* [Documentation](https://explainx-documentation.netlify.app/)
39+
* [Provide Feedback to Improve explainX.ai](https://forms.gle/5Q1xaHd7s6UQkRzf8)
3740

41+
## Installation on your laptop
3842

39-
# Installation
43+
* You can use **explainX** on your own computer in under a minute.
4044

41-
Python 3.5+ | Linux, Mac, Windows (Install [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) first to run on Windows.)
45+
* Make sure you have **Python 3.5+**
4246

43-
```sh
47+
* Open the terminal and run the following to install **explainX**.
48+
```python
4449
pip install explainx
4550
```
51+
* **Jupyter Notebook**: You can also install explainx via Jupyter Notebook. Just run the following command:
52+
53+
```python
54+
!pip install explainx
55+
```
4656

4757
## Installation on the cloud
48-
If you are using AWS SageMaker of Jupyter Notebook deployed on the cloud, visit our documentation for step-by-step guide installing and running explainX. [Cloud Installation Instructions](https://docs.explainx.ai/getting-started/installation)
4958

59+
* Make sure you have **Python 3.5+**
60+
* Install **nodejs** and **localtunnel** using the following instructions.
5061

51-
## Example Usage
52-
After successfully installing explainX, open up your Python IDE of Jupyter Notebook and simply follow the code below to use it:
62+
### To install **nodejs** and **localtunnel** on **MAC OS**
63+
* Open the terminal.
64+
* Install Xcode Command Line Tools using the following.
65+
```python
66+
xcode-select --install
67+
```
68+
* Install **brew** using the following.
69+
```python
70+
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
71+
```
72+
* Install **nodejs** using the following.
73+
```python
74+
brew install nodejs
75+
```
76+
* Install **localtunnel** using the following.
77+
```python
78+
npm install -g localtunnel
79+
```
80+
### To install **nodejs** and **localtunnel** on **Ubuntu**
81+
* Open the terminal.
82+
* Install **nodejs** using the following.
83+
```python
84+
sudo apt install nodejs
85+
```
86+
* Install **npm** using the following.
87+
```python
88+
sudo apt install npm
89+
```
90+
* Install **localtunnel** using the following.
91+
```python
92+
npm install -g localtunnel
93+
```
94+
### To install **nodejs** and **localtunnel** on **CentOS**
95+
* Open the terminal.
96+
* Run the following command.
97+
```python
98+
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -
99+
```
100+
* Install **nodejs** using the following.
101+
```python
102+
sudo yum install nodejs
103+
```
104+
* Install **npm** using the following.
105+
```python
106+
sudo yum install npm
107+
```
108+
* Install **localtunnel** using the following.
109+
```python
110+
npm install -g localtunnel
111+
```
112+
### To install **nodejs** and **localtunnel** on **Windows**
113+
* Install [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/) found [here](https://visualstudio.microsoft.com/visual-cpp-build-tools/).
114+
* Install [Nodejs](https://nodejs.org/en/download/) found [here](https://nodejs.org/en/download/).
115+
* Open the terminal and run the following to install **localtunnel**.
116+
```python
117+
npm install -g localtunnel
118+
```
53119

54-
1. Import **explainx** module.
120+
### Lastly, install **ExplainX** using the following.
55121

56122
```python
57-
from explainx import *
123+
pip install explainx
58124
```
59-
60-
2. Load and split your dataset into x_data and y_data
125+
* **Jupyter Notebook**: You can also install explainx via Jupyter Notebook. Just run the following command:
61126

62127
```python
63-
#x_data = Pandas DataFrame
64-
#y_data = Numpy Array or List
128+
!pip install explainx
129+
```
130+
131+
## Usage
132+
133+
Once you have install explainX, you can simply follow the example below to use it:
65134

66-
x_data, y_data = explainx.dataset_boston()
135+
Import **explainx**
136+
137+
```python
138+
from explainx import *
67139
```
68140

69-
3. Train your model.
141+
Load dataset as X_Data, Y_Data in your XGBoost Model
70142

71143
```python
144+
#X_Data = Pandas DataFrame
145+
#Y_Data = Numpy Array or List
146+
147+
X_Data, Y_Data = explainx.dataset_boston()
148+
72149
#Train Model
73-
model = xgboost.train({"learning_rate": 0.01}, xgboost.DMatrix(x_data, label=y_data), 100)
150+
model = xgboost.train({"learning_rate": 0.01}, xgboost.DMatrix(X_Data, label=Y_Data), 100)
74151
```
75152

76-
4. Pass your model and dataset into the explainX function:
153+
One line of code to **use the explainx module**
77154

78155
```python
79-
explainx.ai(x_data, y_data, model, model_name="xgboost")
156+
explainx.ai(X_Data, Y_Data, model, model_name="xgboost")
80157
```
81158

82-
5. Click on the dashboard link to start exploring model behavior:
159+
Click on the link to view the dashboard.
83160

84-
```python
161+
```jupyter
85162
App running on https://0.0.0.0:8080
86163
```
164+
**Running ExplainX on the cloud e.g., AWS Sagemaker?** **https://0.0.0.0:8080** will not work. You would need to open the **terminal** and run the following command.
87165

88-
**If you are running explainX on the cloud e.g., AWS Sagemaker?** **https://0.0.0.0:8080** will not work.
89-
Please visit our documentation for installation instructions for the cloud: [Cloud Installation Instructions](https://docs.explainx.ai/getting-started/installation)
90-
91-
After installation is complete, just open your **terminal** and run the following command.
92166
```jupyter
93167
lt -h "https://serverless.social" -p [port number]
94168
```
95169
```jupyter
96170
lt -h "https://serverless.social" -p 8080
97171
```
98-
99-
<img width="1000" src="demo-explainx-with-sound.gif" alt="explainX.ai">
100-
101172
Learn to analyze the dashboard by following this link: [explainX Dashboard Features](https://explainx-documentation.netlify.app/analyze-dashboard/)
102173

103-
Visit the documentation to [learn more](https://docs.explainx.ai/)
174+
Visit the documentation to [learn more](https://explainx-documentation.netlify.app/)
104175

105176
## Models Supported
106-
1. Catboost
107-
2. xgboost==1.0.2
108-
3. Gradient Boosting Regressor
109-
4. RandomForest Model
110-
5. SVM
111-
6. KNeighboursClassifier
112-
7. Logistic Regression
113-
8. DecisionTreeClassifier
114-
9. Scikit-learn Models
115-
10. Neural Networks
116-
117-
## Walkthough Video Tutorial
177+
CatBoost, XGBoost, Scikit-learn Models, SVM, Neural Networks
178+
179+
180+
## Video Tutorial
118181

119182
Please click on the image below to load the tutorial:
120183

__pycache__/explain.cpython-37.pyc

66 Bytes
Binary file not shown.
File renamed without changes.

explain.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,14 @@ def ai(self, df, y, model, model_name="xgboost", mode=None):
120120

121121
self.param["is_classification"]= is_classification
122122
self.param["model_name"]= model_name
123+
self.param["model"]= model
124+
self.param["columns"]= df.columns
125+
self.param["y_variable"]= y_variable
126+
self.param["y_variable_predict"]= y_variable_predict
127+
123128

124129
d= dashboard()
125-
d.find(self.df_final, y_variable, y_variable_predict, mode, self.param)
130+
d.find(self.df_final, mode, self.param)
126131

127132
return True
128133

lib/__pycache__/app.cpython-37.pyc

593 Bytes
Binary file not shown.
45 Bytes
Binary file not shown.
-3.39 KB
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
64 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)