Where we start
A bench is a fixed set of rows and a fixed grader, so that when two models give two answers the only thing that differed was the model. Nothing on this bench is simulated. The biopsies are the real 1995 file, each value stored exactly; the split is the one seeded in session 1; both models are fitted by code you can read in the page source, and a separate Python reimplementation of the same algorithm reproduces every count to the biopsy.
★ What you walk out with tonight. The measured answer to "which culture wins on this data" at six settings, the habit of reading accuracy and explanation size together, the base rate as the line every score is read against, and two ways a bench can lie to you: one it catches, and one you have to refuse to click.
Two numbers per culture, one line under both
6 min liveBreiman's culture is judged by accuracy on unseen rows. Box's and Cox's is judged by whether a person can read the model and learn something true from it. The bench prints both for both, so neither culture is graded only on the other's terms.
LiveWhat each readout means4 min▶
Held-out accuracy. Right answers out of the 171 biopsies neither model saw while fitting. Each biopsy is 0.58 points, so read the count, not the decimal.
Numbers to read the whole model (ochre). One coefficient per feature plus an intercept. The bench lists the three largest, standardised so they are comparable, with their signs: a minus leans towards malignant, because benign is coded 1.
Yes or no questions inside it (violet). Every internal node in every tree is one question of the form "is worst area at or below this threshold?". The deepest path is how many questions one biopsy may have to answer. The bench also shuffles one feature at a time across the scored rows and counts the biopsies lost: Breiman's own importance idea from his hepatitis example, done on the held-out rows. Importance says which features matter, never in which direction.
Sign surprises (ochre, small print). How many coefficients point against their own feature's correlation with benign on the training rows. A readable model is only as honest as what it lets you read; session 2 explains where these come from.
Disagreements. The biopsies on which the two cultures give different answers, and which culture was right on each. Every other biopsy gets the same answer from both, so on this data the entire argument lives in these few rows.
Self-studyHow the two engines are built, and how they are checked4 min▶
The regression standardises each feature on the 398 fitting rows, then minimises the log loss plus half the squared size of the weights (scikit-learn's default C=1 objective, intercept not penalised) by Newton's method until the step is below 10-10. scikit-learn 1.9.0 gives the same held-out counts, with every coefficient within 0.000001 of the bench's.
The forest grows each tree on a bootstrap of the fitting rows drawn from a seeded generator, tries the square root of the number of features at every split (5 of 30, or 1 of 3), picks the split with the best Gini gain, and grows until every leaf is pure. The forest averages its trees' leaf shares and says benign above one half. A plain-Python copy of the same seeded algorithm reproduces every count on this page exactly.
The cross-engine tolerance. scikit-learn's own forest uses a different random stream, so it cannot match to the biopsy. Over its seeds 0 to 19 it scores 165 to 168 of 171 with all 30 features (median 167) and 165 to 169 with three (median 167). The bench's forest sits inside both ranges. Any forest-versus-regression gap smaller than that range is a gap between random draws, not between cultures.
The creators' own model had three features. The file's documentation, written by Wolberg, Street and Mangasarian in 1995, reports that the best predictive accuracy came from one separating plane in the space of just three features, worst area, worst smoothness and mean texture, with an estimated 97.5 percent from repeated ten-fold cross-validation, and that the classifier "has correctly diagnosed 176 consecutive new patients as of November 1995". That is their figure with their method; the bench's "creators' 3" lever lets both cultures try the same three features on our split.
Six rungs, computed in front of you
★ 26 min · the main eventWork through the six settings in the table under the bench, in order. At each one, read the verdict line, then both columns top to bottom, then the disagreement line. Say out loud which number moved and which did not before moving on. The first four change the models. The fifth changes the grader. The sixth breaks the data on purpose.
| Rung | Set the levers to | What to watch |
|---|---|---|
| 1 | All 30 · 100 · Held-out · Real | The default. The regression is ahead, and the whole gap is 3 biopsies |
| 2 | The creators' 3 · 100 · Held-out · Real | The regression shrinks to 4 numbers; the forest grows; the lead changes hands |
| 3 | All 30 · 1 tree · Held-out · Real | A single tree: 19 questions, readable, and 12 biopsies behind |
| 4 | All 30 · 10 · Held-out · Real | Ten trees already recover everything the hundred do |
| 5 | All 30 · 100 · Training rows · Real | The peek: a perfect score that means nothing |
| 6 | All 30 · 100 · Held-out · Shuffled | The break: both cultures fall towards the base rate |
Read it in this order. Base rate, then the two accuracy counts, then the disagreement line, then the second numbers. It is tempting to read the two big percentages and stop. On this data the percentages differ by a few biopsies at every honest rung, and the second numbers differ by a factor of fifty.
The readable model wins, then it doesn't, and neither result is a verdict
7 min liveOn all 30 features the logistic regression is right on 170 of the 171 held-out biopsies and the forest on 167. Restrict both to the three features the dataset's creators chose and the order flips: forest 168, regression 167. Breiman's Table 2 had forests halving tree errors; on this file, the data modelling culture holds its own.
| Rung | Regression (ochre) | Forest (violet) | Disagree on | Second numbers |
|---|---|---|---|---|
| All 30, 100 trees | 170 of 171, 99.4% | 167, 97.7% | 3 (regression right on all 3) | 31 numbers vs 1,647 questions, depth 11 |
| The creators' 3, 100 trees | 167, 97.7% | 168, 98.2% | 5 (regression 2, forest 3) | 4 numbers vs 2,700 questions, depth 13 |
| All 30, 1 tree | 170, 99.4% | 158, 92.4% | 12 (regression right on all 12) | 31 numbers vs 19 questions, depth 8 |
| All 30, 10 trees | 170, 99.4% | 167, 97.7% | 3 (regression 3) | 31 numbers vs 152 questions, depth 9 |
LiveWhy the readable model does so well here3 min▶
The creators' documentation says the two classes are linearly separable using all 30 features. A boundary that is close to a flat plane is exactly what a logistic regression draws, so on this file the data modelling culture's guess about the inside of the box happens to be nearly right. Breiman's argument was never that the equation is always wrong; it was that nobody checks. Here the check, 170 of 171 on unseen biopsies, is the credential.
Notice also what three features do to each culture. The regression becomes a model a clinician could hold in one hand: four numbers, with worst area carrying most of the weight (standardised coefficient -4.63), and no sign surprises. The forest, given fewer features to choose between, grows larger, 2,700 questions against 1,647, because each tree has to carve the same boundary out of fewer directions.
Self-studyThe lone tree, and Breiman's grades2 min▶
Set the forest to one tree. It asks 19 questions, never more than 8 on one biopsy, and you could draw it on a whiteboard, which is Breiman's "A+ on interpretability". It is also 12 biopsies behind the regression, every one of them a biopsy the regression gets right: "a B on prediction". Ten trees close almost all of that gap with 152 questions, and a hundred add nothing further. The step from a readable tree to an unreadable forest is where the Occam dilemma of session 1 lives, and on this data it is paid for in the first ten trees.
Hoadley's Fat Scorecard, in the same issue. Bruce Hoadley of Fair, Isaac reported fitting a plain logistic regression on credit data and finding that "all models fit with anywhere from 27 to 36 characteristics had the same performance on the test sample". His 27-characteristic scorecard slightly outperformed a neural network with 2,000 connection weights. He called it an excellent algorithmic model made from a simple data modelling tool. The bench's first rung is the same shape of result on a different domain.
Two ways a bench can lie, and how this one tells you
5 min liveA bench earns trust by being able to report a worse number. Rung 6 proves this one can: shuffle the training labels so no real signal is left, and both cultures fall from the high nineties towards the base rate. Rung 5 shows the opposite failure, a number that looks better than anything honest, produced by grading a model on the rows it memorised.
LiveWhy the break does not reach exactly 62.6 percent2 min▶
With the labels shuffled, there is nothing true left to learn, so a model's best move is to call most biopsies benign. The regression lands on 116 of 171 and the forest on 114, against the do-nothing 107. The residue is what one particular shuffle leaves behind by chance: the bench uses one fixed permutation so every visitor sees the same numbers, and a different permutation would give a slightly different residue. The honest reading is the size of the fall, 54 and 53 biopsies, not the exact landing point. The forest, meanwhile, grows 6,730 questions deep into nothing, four times its honest size: a complex model will always find something to fit.
Self-studyThe peek in real projects2 min▶
Nobody sets a switch that says "grade on the training rows". The peek arrives by degrees: tuning a setting until the test score improves, choosing among ten candidate models by their test score, re-splitting after a disappointing result. Hoadley names it in his comment on Breiman, "in industry and academia, there is sometimes a little tinkering, which involves peeking at the test sample. The result is some bias in the test sample or cross-validation results", and asks the question that has no easy answer: "How do you optimize your results and get an unbiased estimate of the generalization error?" Session 3 is about the discipline that answers it; session 5 is about the institution, the common task framework, that enforces it.
Before session 5
30 min- Fill the six-rung table from the bench yourself: both counts, the disagreement split and both second numbers. Circle the rung you would defend to a clinician, and the one you would defend to a data science lead.
- Compare with your session 1 seed range. Is the forest's score at rung 1 inside the 20-seed range you recorded? What does that say about the 3-biopsy gap?
- Write the peek in your own project. Name one decision in your last model build that used the test set before the final grade. Say what an untouched set would have cost you.
- Read Donoho's section 6 on the common task framework before session 5. Mark the three ingredients.
Three questions
Clear all three and session 4 gets stamped in your passport.
1 · With the creators' 3 features the forest gets 168 of 171 and the regression 167. What is the honest conclusion?
A one-biopsy lead inside the forest's own seed-to-seed range is noise between random draws, not a difference between cultures. The creators' figure used a different method and repeated cross-validation, so it is not comparable to one fixed split.
2 · Why does the break button make the bench more trustworthy rather than less?
The break is a placebo. If scores stayed high with the labels shuffled, the bench would be measuring a leak or a bug. The residue above 107 is one fixed shuffle's chance pattern, and the page says so rather than hiding it.
3 · Graded on the training rows, the forest scores 398 of 398. Graded on the held-out rows, 167 of 171. Which number goes in the report?
Both are real counts; only one answers the question. The regression shows the subtler lesson in the same rung: its held-out 99.4 percent is higher than its training 98.5 percent, because 171 rows is small and can flatter a model as easily as punish it.
What this session teaches, and where it came from
Every fact on this page, and its verification tier, is recorded in the course's source map.
Session 4 cheat sheet · pin this
The bench worked because the 171 rows were fixed before either model existed and graded once. David Donoho argues that exactly this arrangement, a shared dataset, a sequestered test set and a referee, is "the secret sauce" of machine learning. Session 5 reads his "50 Years of Data Science", from Tukey's 1962 manifesto to the six divisions of what he calls greater data science.