Friedman’s H-statistic

Also known as: H-statistic · feature interaction strength

On this page 7

Friedman’s H-statistic is a model-agnostic measure of feature interaction strength that estimates what share of the variation in a model’s predictions comes from features acting jointly rather than separately. In Explainable AI, it answers a question that additive attribution methods leave open: does the effect of one feature depend on the value of another?

Jerome H. Friedman and Bogdan Popescu introduced the statistic in 2008 alongside the RuleFit method. It builds on partial dependence functions and compares the joint partial dependence of a feature pair with the sum of the individual ones. A value near 0 means no interaction, and a value near 1 means the joint effect is almost entirely interaction.

How the H-statistic decomposes partial dependence

The H-statistic rests on a simple identity: if two features j and k do not interact, their centered two-way partial dependence equals the sum of the two centered one-way partial dependence functions. Any remaining difference is interaction, and the statistic measures its size relative to the joint effect.

For a pair of features, the squared two-way statistic is the sum over data points of the squared difference between the joint partial dependence and the two individual ones, divided by the sum of the squared joint partial dependence. The square root gives H on a comparable scale. All partial dependence functions must be centered to mean zero before the comparison, otherwise constant offsets distort the ratio.

The table lists the main variants of the statistic and the question each one answers.

VariantWhat it comparesQuestion answered
Two-way H for a pairJoint PD of j and k versus PD of j plus PD of kDo j and k interact with each other
Total H for one featureFull prediction versus PD of j plus PD of all other featuresDoes j interact with anything
Three-way HJoint PD of three features versus all lower-order termsIs there a genuine three-feature interaction
Unnormalized HSquare root of the numerator onlyHow large is the interaction in prediction units
Variants of Friedman’s H-statistic

Reading and interpreting H values

The normalized H-statistic is a proportion of explained variance, not a measure of importance. A pair can have a high H yet matter little to predictions when the joint effect itself is small. For that reason, practitioners often report the unnormalized version, which expresses interaction strength in the units of the prediction.

The ranges below are rough interpretive guidance, not formal thresholds; the right reading always depends on model type, sample size and the noise in the estimate.

H valueTypical readingSuggested follow-up
0 to 0.05Negligible interactionTreat the pair as additive
0.05 to 0.2Weak but possibly real interactionCheck stability across samples
0.2 to 0.5Substantial interactionInspect a two-way partial dependence plot
Above 0.5Joint effect dominated by interactionConfirm with ICE plots and domain knowledge
Rough interpretation of normalized H values

Values slightly above 1 can occur in rare cases, for example when the individual partial dependence functions are larger in magnitude than the joint one and point in opposite directions. Such results signal an unusual model structure rather than an error in the formula.

How it compares with other interaction methods

Friedman’s H-statistic is one of several ways to quantify interactions, and it is distinct in being global, model-agnostic and normalized. Other methods trade these properties for speed, locality or fewer assumptions.

MethodScopeModel accessMain limitation
Friedman’s H-statisticGlobal, per pair or featureAny model, predictions onlyQuadratic cost, assumes independence
SHAP interaction valuesLocal and aggregatedFast only for tree models via TreeSHAPHard to compute for other models
Two-way ALE plotsGlobal, visualAny modelVisual only, no single summary number
ICE curve heterogeneityLocal, per featureAny modelShows that interaction exists, not with which feature
Explainable boosting machineGlobal, built into the modelGlass-box model onlyDetects pairs only during training
Interaction measures in explainable AI

A common workflow uses H as a screening tool: compute the total statistic for each feature, select the features that interact most, and then compute two-way statistics only for those. Detailed plots such as accumulated local effects or individual conditional expectation curves then show the shape of the interaction.

Computational cost and estimation in practice

The H-statistic is expensive to compute. Estimating one partial dependence value at one point requires predictions over the whole dataset, so a two-way statistic evaluated at n points needs on the order of n squared model calls. With 10,000 rows, one pair already demands about a hundred million predictions.

  • Subsample the evaluation points, typically to 200-1,000 rows, and accept some estimation noise.
  • Screen with total H first, then test only the top pairs instead of all p(p-1)/2 combinations.
  • Repeat with different seeds to see whether the ranking of pairs is stable.
  • Use established implementations, such as the R packages iml and hstats or interact.gbm in gbm.

The statistic has no built-in significance test. Friedman and Popescu proposed a reference distribution obtained by fitting additive models to bootstrapped data, but this multiplies the cost and is rarely done. Without it, small nonzero values cannot be separated from sampling noise.

Limitations and common mistakes

The most serious limitation is inherited from partial dependence: the method averages predictions over combinations of feature values that may never occur together. When features are strongly correlated, the model is queried in unrealistic regions, and H can report interactions that reflect extrapolation rather than learned structure.

MistakeConsequenceBetter practice
Reading H as importanceSmall effects look criticalReport unnormalized H alongside
Ignoring correlated featuresSpurious interactionsCheck correlations and compare with ALE
Using very small samplesUnstable rankingsRepeat estimates and average them
Interpreting H as causalFalse claims about the real worldState that H describes the model only
Frequent mistakes with the H-statistic

In everyday language

Some factors work alone. Others work as a team. Think of salt and sugar in baking. Each one changes the taste on its own. Together, they can create a taste that neither gives alone.

Friedman’s H-statistic checks whether a model treats its inputs as a team. It gives a score between 0 and 1. A score of 0 means the inputs act separately. A score near 1 means their combined effect matters most. The check needs many calculations. It can also be misled when inputs always move together.

Seen in the real world

A credit risk team at a mid-sized bank trains a gradient boosting model on 40 features to predict loan default. Model validators ask whether the model relies on hidden feature interactions that a simple scorecard would not capture.

The analysts sample 600 applications and compute the total H-statistic for every feature. Debt-to-income ratio and employment length show the highest values, around 0.3. A two-way check for that pair returns H of about 0.25, while most other pairs stay below 0.05.

A two-way partial dependence plot then shows that high debt raises risk sharply only for applicants with short employment history. The validators document this interaction in the model report, and the team adds an explicit interaction term to the backup scorecard, which narrows the performance gap between the two models.