liveBook · Manning

Global explanation

As explained in Ensemble Methods for Machine Learning

A global interpretability method explains a model's overall behavior, features, and decision-making patterns across a broad range of examples.

Global explanation describes how a model generally behaves across many examples: which factors matter broadly and how decisions change in aggregate. It is useful when a model supports high-stakes decisions, debugging, failure analysis, bias investigation, or improvement work. section 9.0 section 9.3

A global method asks, “What sensible pattern has this model learned?” rather than, “Why did it make this one prediction?” Local explainability focuses on an individual example; global explainability considers behavior over a large number of examples. section 9.3

Common global approaches include:

  • Feature importance assigns scores to features according to their contribution to correct target prediction. section 9.6
  • Permutation feature importance compares predictive performance before and after shuffling features, treating the trained model as a black box. section 9.6
  • Partial dependence plots marginalize, or sum out, other variables to show how a feature relates to model output. section 9.6
  • Global surrogate models approximate a black-box model with an interpretable model, balancing fidelity against interpretability. section 9.6

Black-box global methods use only model inputs and outputs, not internal model structure, so they are model-agnostic. Glass-box approaches instead expose interpretable structure directly. Explainable boosting machines provide both global and local explanations through feature components and selected pairwise interactions. section 9.3 section 9.5

Bank-marketing EBM

An ExplainableBoostingClassifier trained on the Bank Marketing data produces global feature-importance scores and dependency plots. A dependency plot for age shows negative scores for normalized values corresponding to ages 33–49, suggesting lower subscription likelihood absent other information. Its accuracy is comparable to the referenced XGBoost model while remaining a glass-box model. section 9.5.2

Listing 9.11 Training and visualizing EBMs using InterpretML
from interpret.glassbox import ExplainableBoostingClassifier
 
wts = np.full_like(ytrn, fill_value=1.0)     
wts[ytrn > 0] = 5.0                                                     #1
 
feature_names = list(Xtrn.columns)
feature_types = np.full_like(feature_names, fill_value='continuous')
cat_features = ['default', 'housing', 'loan', 'contact', 'poutcome', 
                'job', 'marital', 'education', 'month', 'day_of_week']
feature_types = ['categorical' if f in cat_features else 'continuous' 
                 for f in feature_names]                                #2
 
ebm = ExplainableBoostingClassifier(feature_names=feature_names, 
                                    feature_types=feature_types)
ebm.fit(Xtrn, ytrn, sample_weight=wts)                                  #3
 
from interpret import set_visualize_provider                            #4
from interpret.provider import InlineProvider
set_visualize_provider(InlineProvider())
 
from interpret import show                                              #5
x = Xtst.iloc[3104, :].values.reshape(1, -1)
y = ytst[3104].astype(float).reshape((1, 1))
 
local_explainer = ebm.explain_local(x, y)                               #6
show(local_explainer)
 
ebm_global = ebm.explain_global()                                       #7
show(ebm_global)

The listing shows how to train an ExplainableBoostingClassifier with feature types and class-imbalance weights before generating global visualizations. section 9.5.2

How Ensemble Methods for Machine Learning covers it

How deep it goes
Covers model-agnostic methods, feature scores, marginalization, surrogate fidelity, and glass-box EBM structure.
Examples
Uses feature-importance scores, dependency plots, Bank Marketing predictions, and an ExplainableBoostingClassifier.
What it assumes
Assumes familiarity with machine-learning models and predictions while distinguishing black-box from glass-box behavior.
What you can do after
Evaluate model-wide behavior with importance scores and dependency plots, or train an interpretable EBM with InterpretML.
How it connects
Connects black-box models, glass-box models, local explainability, feature importance, partial dependence, surrogate models, and generalized additive models.

Also explained in

Compare how 2 books explain global explanation →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Ensemble Methods for Machine Learning. The section links point to the parts of the book it draws on.