Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
slundberg authored Apr 11, 2018
1 parent f735190 commit e185ad9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
pip install shap
```

## XGBoost example
## Tree ensemble example (XGBoost, LightGBM, and scikit-learn tree models)

While SHAP values can explain the output of any machine learning model, we have developed a high-speed exact algorithm for ensemble tree methods ([Tree SHAP arXiv paper](https://arxiv.org/abs/1802.03888)). Fast C++ implementations are supported for *XGBoost*, *LightGBM*, and *scikit-learn* tree models through the `shap` package:
While SHAP values can explain the output of any machine learning model, we have developed a high-speed exact algorithm for tree ensemble methods ([Tree SHAP arXiv paper](https://arxiv.org/abs/1802.03888)). Fast C++ implementations are supported for *XGBoost*, *LightGBM*, and *scikit-learn* tree models through the `shap` package:

```python
import xgboost
Expand All @@ -33,6 +33,7 @@ X,y = shap.datasets.boston()
model = xgboost.train({"learning_rate": 0.01}, xgboost.DMatrix(X, label=y), 100)

# explain the model's predictions using SHAP values
# (same syntax works for LightGBM and scikit-learn models)
shap_values = shap.TreeExplainer(model).shap_values(X)

# visualize the first prediction's explanation
Expand Down

0 comments on commit e185ad9

Please sign in to comment.