Machine learning · Interpretability · Market stress

How to See Beyond the Forest

Turning 1,000 Random Forest trees into economic ideas a person can examine

Data essay · September 2026

Random Forest · Quantile Random Forest · Rules · Regimes · Tail risk

I ride Seattle's bike trails daily. Those rides give me time to reflect. This morning Mount Rainier was particularly clear, and the view gave me an insight about the machine-learning exercise I had been working on: Can we not turn 1,000 trees into an equation that we can understand?

The question sounds almost contradictory. We use Random Forest because we do not want to impose a simple functional form. Hundreds or thousands of trees are free to search for nonlinearities, interactions and thresholds. The resulting model can predict well—but then we are left staring at the forest.

This article continues the argument in my previous post, Don't Forget BLUE. There I argued that machine learning and econometrics answer different questions: OLS gives us familiar coefficient-based inference, while Random Forest gives us flexible nonlinear prediction. Here I ask the next question: what did the forest actually learn?

The experiment

We use the same BIS-inspired teaching exercise: a Treasury Market Conditions Indicator as the dependent variable, with federal debt held by the public as a percent of GDP and NBFI Treasury holdings as explanatory variables. This is not a causal model or a replication of the full BIS specification. Its purpose is to make the machinery visible.

Forest interpretation workflow
Figure 1. The interpretability path: forest → exact equation → terminal rules → recurring regimes → conditional tails.

A forest really is an equation

A regression tree is a piecewise-constant function. If tree b contains terminal regions R and predictions c, it can be written as:

Tb(x) = Σℓ cbℓ I{x ∈ Rbℓ}

A Random Forest containing B trees is their average:

f̂(x) = (1/B) Σb Tb(x) = Σb,ℓ (cbℓ/B) I{x ∈ Rbℓ}
The same equation in plain English
Forest Prediction = Σ (Leaf Prediction × Leaf Weight × 1[Rule is true])
A Random Forest is a very large collection of “if this, then that” rules whose predictions are averaged together.

For our fitted model, B = 1,000 and the forest contains 12,169 terminal rules. That is exact algebra, but replacing 1,000 pictures of trees with 12,169 indicator terms has not yet solved the human problem.

EXTRACT(RF,equation)
EXTRACT(RF,rules)
EXTRACT(RF,regimes)

From rules to regimes

Bootstrap sampling means different trees often discover nearby thresholds. One tree may split Debt/GDP near 95%, another near 96%, another near 97%. Those need not represent three distinct economic stories. They can be interpreted as repeated votes for a similar region of predictor space.

RainbowStats therefore clusters nearby thresholds chosen by the fitted trees. It reports the threshold neighborhood, split votes, trees voting, tree-vote percentage, node observations and the average right-minus-left change in the forest prediction.

Debt GDP forest regimes
Figure 2. Selected Debt/GDP regimes found by the forest. The relationship is plainly nonlinear: the sign and magnitude of the local prediction change vary across threshold regions.
Approx. Debt/GDP thresholdTrees votingTree voteMean right−left MCI
52.3%61161.1%−1.24
71.5%63463.4%+0.31
77.6%31931.9%+0.73
85.6%14814.8%+1.11
93.6%27027.0%+0.84
96.7%22622.6%+2.26
Interpret the thresholds carefully. They are recurring predictive boundaries in this fitted sample, not causal tipping points. A split means that separating observations there helped the trees predict MCI conditional on the other tree decisions.

What the regimes tell us

The most important result is not simply that “debt matters.” The forest finds a non-monotonic relationship. Around 52% Debt/GDP the average local right-minus-left prediction is negative, while several higher-debt regions are positive. Near the 95.7–97.5% neighborhood, 226 trees select a split and the average local prediction difference is roughly +2.26 MCI units.

NBFI holdings also generate repeated threshold regions with both positive and negative local differences. Again, this is predictive structure rather than a causal claim. But it tells us something a single slope coefficient cannot: the fitted relationship changes across the predictor space.

OLS and the forest answer different questions

OLS compresses the relationship into coefficients, standard errors and familiar inferential diagnostics. Random Forest gives up that compact representation to discover nonlinear predictive structure. The new extraction tools let us interrogate what we gave up.

SLIDE(EXTRACT(RF,regression))
EXTRACT(RF,equation)
EXTRACT(RF,rules)
EXTRACT(RF,regimes)

The regression asks, “What does the average linear relationship look like?” The forest tools ask, “What nonlinear boundaries did the machine repeatedly use?” This is a complement to Don't Forget BLUE, not a rejection of it.

Then Quantile Random Forest changes the question

A conventional regression forest averages terminal predictions. Quantile Random Forest retains the observations occupying those terminal leaves and uses their forest weights to estimate a conditional distribution. We can therefore use the same interpretability sequence and then examine the tails.

EXTRACT(QRF,equation)
EXTRACT(QRF,rules)
EXTRACT(QRF,regimes)
EXTRACT(QRF,quantiles)
Simplified Random Forest equation and interpretation
Figure 3. The forest in plain English: weighted leaf predictions activated by rules. Repeated rules reveal regimes; QRF carries those neighborhoods into the conditional distribution and its tails.

From a black box to a conversation

Calling a Random Forest a “black box” can become an excuse not to interrogate it. A tree itself is simple: variable → threshold → left or right → prediction. Complexity comes from repetition.

Our workflow is therefore straightforward: fit the forest; write its exact algebraic representation; expose its terminal rules; consolidate repeated thresholds into regimes; count how much of the forest votes for each regime; examine how predictions differ across those boundaries; and finally use QRF to examine the conditional tails.

We have not made the model simple. We have made its complexity inspectable.

How to see beyond the forest

My bike ride began with Mount Rainier and a simple question: can we turn 1,000 trees into an equation we can understand?

The answer is both yes and no. Yes, because the forest has an exact algebraic representation. No, because an equation containing 12,169 indicator terms is scarcely more understandable than 1,000 trees.

The useful insight comes one step later. Those thousands of rules are not necessarily thousands of independent ideas. Trees repeatedly discover similar boundaries. Once those repeated decisions are collected, a much smaller set of recurring regimes begins to emerge.

Then the conversation changes from “the Random Forest says so” to something we can examine: hundreds of independently bootstrapped trees repeatedly partitioned the data in this neighborhood, and the fitted prediction changed materially across that boundary.

That is where econometrics and machine learning complement one another particularly well. OLS gives us a compact inferential model. Random Forest gives us flexible nonlinear predictive structure. Rule and regime extraction helps us understand what created that structure. Quantile Random Forest shows how that structure reaches into the tails.

The objective is not to choose between econometrics and machine learning. It is to keep asking the machine enough questions that we understand what it has actually learned.

And sometimes, apparently, it takes a bike ride and a mountain to think of the question.

Prior work: interpreting the forest

Extracting interpretable rules from Random Forests is an established area of research. One especially relevant precedent is SIRUS (Stable and Interpretable RUle Set), developed by Clément Bénard, Gérard Biau, Sébastien da Veiga and Erwan Scornet. SIRUS starts from Random Forests and extracts a short, stable set of rules; importantly for our exercise, the authors emphasize that interpretability should include stability when the data are perturbed.

Our RainbowStats exercise takes a somewhat different route. Rather than replacing the fitted forest with a small surrogate model, we retain the forest itself. We expose its exact indicator-function equation and terminal rules, then consolidate nearby split thresholds into recurring regimes and report how many trees vote for those regimes and the average right-minus-left prediction contrast across the corresponding splits. The purpose is not to make the forest linear. It is to make the complexity already inside the fitted forest inspectable.

That distinction also suggests a useful next experiment. Our present threshold clustering is a descriptive simplification. We can refit forests under different seeds or bootstrap samples and ask whether the same regimes continue to appear. If the boundaries are stable across perturbations, we have stronger evidence that they reflect persistent structure in the fitted relationship rather than the accident of one particular forest realization. This is closely related to the stability motivation behind SIRUS, although our regime construction is different.

Quantile Random Forest adds another dimension. Meinshausen showed that a Random Forest can retain information about the full conditional distribution of the response, not merely its conditional mean. That is why the progression in this exercise can continue from rules → recurring thresholds → regimes → conditional tails.

What is established and what is our experiment?
Rule extraction and stability-based Random Forest interpretation have an established literature. Quantile Regression Forests are also established. The particular RainbowStats workflow used here—exact forest equation, terminal rules, clustering of nearby split thresholds into regimes, tree-vote counts, local right-minus-left prediction contrasts, and then inspection of QRF tails—is our practical synthesis of those ideas. It should be treated as an interpretive experiment, not as a claim that we have invented Random Forest interpretability.

References

Bénard, C., Biau, G., da Veiga, S. & Scornet, E. (2021). “Interpretable Random Forests via Rule Extraction.” Proceedings of the 24th International Conference on Artificial Intelligence and Statistics, PMLR 130:937–945. PMLR paper.

Meinshausen, N. (2006). “Quantile Regression Forests.” Journal of Machine Learning Research 7(35):983–999. JMLR paper.