How gradient‑boosted trees learn
The mechanism behind Phase 2's XGBoost classifier and a Sw regressor built the same way: not one tree guessing the answer, but a relay of shallow trees, each one built purely to correct what the trees before it got wrong. Worked through with real numbers on five depth samples, predicting water saturation (Sw) from resistivity and porosity.
The five depth samples
A held-out well isn't used for training — but for this walkthrough, imagine five depth samples with a true Sw value each (say, from a nearby DST-confirmed interval). Every tree round starts from these same rows.
| Depth (m) | Rt (Ω·m) | φ (porosity) | True Sw |
|---|---|---|---|
| 2041.5 | 84 | 0.19 | 0.18 |
| 2043.0 | 22 | 0.21 | 0.46 |
| 2044.5 | 6 | 0.24 | 0.81 |
| 2046.0 | 3 | 0.22 | 0.94 |
| 2047.5 | 61 | 0.20 | 0.24 |
Three boosting rounds
Round 0 is a flat guess — just the average Sw across all five rows, before any tree has looked at a single curve. Each round after that: measure the residual (true − current prediction), grow one small tree whose entire job is to predict that residual, then add a shrunk version of its output onto the running total.
Every row predicted as the mean
mean(0.18, 0.46, 0.81, 0.94, 0.24) = 0.526. Every row is equally wrong.Residual to fix
asks: is Rt < 15?
Running prediction (+ shrunk tree output)
Residual still left
asks: is φ > 0.205?
Running prediction
Where it lands after 200 rounds
Two rounds already pulled the prediction from a flat 0.526 to within a few hundredths of the true Sw. Phase 2 doesn't stop at 2 rounds — it runs 200, each one nudging the total a little further, with a shrinkage factor (the learning rate) keeping any single tree from overcorrecting.