Demonstration 1 of 1
A teammate's OOF file joined by position or by ID
How much of a blend's gain is lost, and what does it look like, when a teammate's OOF file is joined by position but is partly out of order?
Both files still have one finite probability per position, so nothing fails to run. A join by position pairs some of model A's predictions with predictions for other rows, so teammate B looks weaker than it is and both an average blend and a stack gain less; once the file is fully shuffled the stack learns to ignore the column. A join by ID restores every pair, and the full blend gain.
Scroll sideways for the whole equation
a_i and b_i are the two models' out-of-fold probabilities for row i, pi(i) the row that the file holds at position i, and the blend is the mean of the two columns.
Predict first. A quarter of teammate B's rows are saved out of order and the blend is joined by position. Where does its AUC land compared with the join by ID and with model A alone?
Choose an example
Scroll sideways for the whole figure
Constructed example: six seeded synthetic tasks, logistic regression and extremely randomized trees, measured by the chapter activity.
Calculated values
- Blend by ID
- 0.813
- Average blend by position
- 0.798
- Model A alone
- 0.771
- Teammate B alone, file order
- 0.622
- Positions matching their IDs
- 75%
With 500 of 2000 rows out of order (25%), the blend joined by ID scores 0.813, model A alone 0.771, and the blend joined by position 0.798: 0.813 - 0.798 = 0.015 of AUC lost, 35% of the 0.043 the blend gains over model A. The teammate's model scores 0.622 alone in file order against 0.660 by ID, and the stacked blend by position scores 0.798 against 0.818 by ID. Only 75% of positions match their IDs, which an ID check would have reported.
Worked steps
- Blend by ID: 0.813; model A alone: 0.771; gain 0.813 - 0.771 = 0.043.
- Average blend by position: 0.798; lost 0.813 - 0.798 = 0.015.
- Stack by position: 0.798 against 0.818 by ID.
- Teammate B alone: 0.622 in file order, 0.660 by ID.
Use the idea
Agree on one saved format with an ID column, a fold column and class order; assert unique IDs and equal ID sets before every join, and join by ID, never by position.
Where the conclusion applies
Constructed data with one linear and one tree model on disjoint features, a deliberately complementary pair; real pairs gain less. Misalignment here is a random shuffle of the stated share of rows. This is a data-contract effect only and says nothing about portfolios, teams or hiring.
Check your understanding: With the file fully shuffled, the average blend falls below model A alone while the stacked blend only matches it. Why do they differ?
Chapter 24 source: section "Solo or Team".