%matplotlib inline
import lightgbm as lgb
lgb.__version__
import plotly
plotly.__version__
import shap
shap.initjs()
shap.__version__
X, y = shap.datasets.adult()
print(y)
X
from lightgbm.sklearn import LGBMClassifier
model = LGBMClassifier()
sh = Shap(X, y, model)
sh.waterfall_plot(id=0)
import plotly.io as pio
print(pio.renderers.default)
sh.wf_plot(3)
sh.wf_plot(3, n_pos=3, n_neg=3, title="Features' impact")
sh.wf_plot(3, n_feature=8, n_pos=3, n_neg=3)
sh.bar_plot(id=0, figsize=(5,3))
sh.force_plot()
sh.force_plot(1000)