pip install interpret★Everything — glassbox, blackbox, viz (Python 3.5+).conda install -c conda-forge interpretConda alternative.pip install interpret-coreMinimal — no viz/plotly deps; pick your own extras.from interpret import show★The one render function both paths share.
from interpret.glassbox import ExplainableBoostingClassifier★The EBM — accurate as boosting, exact as a GAM.ExplainableBoostingRegressor()★EBM for regression.LogisticRegression · LinearRegressionClassic linear glassbox + built-in explanations.ClassificationTree · RegressionTreeShallow decision-tree glassbox.APLRClassifier · APLRRegressorAutomatic Piecewise Linear Regression.
ebm = ExplainableBoostingClassifier()★Defaults are strong — train first, tune later.ebm.fit(X_train, y_train)★Standard sklearn — no preprocessing needed.ebm.explain_global()★exactOverall term importances + shape graphs.ebm.explain_local(X_test[:5], y_test[:5])★exactPer-prediction breakdown into ± term scores.ebm.predict(X) · ebm.predict_proba(X)It's still a normal sklearn estimator.
show(ebm.explain_global())★One explanation — dropdown to drill per feature.show(local, 0)Jump straight to instance index 0.show([g_hist, ebm_global, lr_global])★Pass a list → full comparison dashboard.from interpret import preserveSave a single viz to a standalone HTML file.explanation.data(0)Raw JSON behind a graph (-1= all).
from interpret.blackbox import LimeTabular★approxLocal surrogate around each prediction.lime = LimeTabular(model, X_train)Pass the fitted pipeline + background data.lime.explain_local(X_test[:5], y_test[:5])★Same verb, same UI as glassbox.ShapKernel(model, X_train)approxKernel SHAP — model-agnostic contributions.PartialDependence(model, X_train)Global PDP — average effect of a feature.MorrisSensitivity(model, X_train)Global one-at-a-time sensitivity screening.
from interpret.greybox import ShapTreeFast TreeSHAP for tree ensembles (XGB/LGBM/RF).st = ShapTree(tree_model, X_train)Exploits tree structure — exact SHAP, quickly.st.explain_local(X_test[:5])Greybox = knows a bit about the model internals.
from interpret.data import ClassHistogram★Interactive EDA — class balance per feature.hist = ClassHistogram().explain_data(X, y)explain_datais the data-module verb.Marginal().explain_data(X, y)Marginal response of each feature vs target.show(hist)Same render path — drop it in the dashboard.
from interpret.perf import ROC★Interactive ROC curve for a classifier.ROC(model.predict_proba).explain_perf(X_test, y_test)explain_perfis the perf-module verb.PR(model.predict_proba)Precision–recall curve.RegressionPerf(model.predict)Residuals / error diagnostics for regressors.
ebm.monotonize("Age")★Force a term monotone (isotonic post-hoc fix).ebm.term_importances()Mean |score| per term — the global ranking.ebm.remove_terms([...]) · ebm.scale(...)Prune or reweight terms directly.ebm.sweep()Purge zeroed / unused terms & bins.ebm.to_excel("ebm.xlsx") · ebm.to_json(...)Export the full model as a lookup table.
from interpret.glassbox import merge_ebmsBlend several EBMs into one — stays glassbox.merge_ebms([ebm1, ebm2, ebm3])Great for distributed / federated training.ebm = EBMClassifier(interactions='3x')Auto pairwise interactions on by default.# 100M rows in hours; distributed on SynapseMLScales to very large datasets on Azure.
from interpret.privacy import DPExplainableBoostingClassifierEBM with (ε, δ)-differential-privacy guarantees.DPExplainableBoostingRegressor(epsilon=1.0)Private + still fully interpretable.
from interpret import set_visualize_providerChoose how/where visuals appear.from interpret.provider import InlineProviderRender inline (notebooks, Colab, VS Code).set_visualize_provider(InlineProvider())★Fixes "nothing shows up" in many envs.from interpret import init_show_serverDash server mode for the pop-out dashboard.
y-axis = scorecontribution added to the predictionclassifier → logitslog-odds, not probability (like logistic reg.)regressor → target unitsadded straight to the interceptinterceptbase rate (clf) / mean target (reg)pred = intercept + Σ term_scoresevery term is a lookup table, then summedpairwise term f(xᵢ,xⱼ)an auto-detected interaction, shown as a heatmap