The Penguin Paradox: How to Tell Three Species Apart When the Average Lies
A full classification of 344 real penguins — a bill correlation that runs backwards until you split it, then the tree, forest and PCA that read the species off a ruler. No code.
palmerpenguins — 344 real Antarctic penguins (species, island, bill length & depth, flipper length, body mass), collected by Horst, Hill & Gorman at the Palmer research station.
Download the CSV and follow along in Stratum — every figure below is a real screenshot from this file.
Here is a fact about penguins that should be impossible. In a dataset of 344 real penguins from the Palmer Archipelago in Antarctica, the longer a penguin's bill is, the shallower it tends to be. Measure bill length, measure bill depth, correlate the two, and you get −0.24 — a real, statistically significant negative relationship. Longer bills are thinner bills.
That's biologically backwards — a bigger animal usually has a bigger everything — and it's the first sign a number is about to lie to you. It's the same shape of problem as the diamond paradox, where the best-graded diamonds looked cheapest: a headline relationship that runs exactly the wrong way because a hidden grouping is pulling the strings. This time the grouping is species, and cracking it is a complete tour of a classification workflow — charts, ANOVA, a decision tree, a random forest, and PCA — no code.
Step 1 — Look before you model
The dataset has three species (Adélie, Chinstrap, Gentoo) across three islands, and four measurements per bird: bill length, bill depth, flipper length, body mass. Two birds are missing measurements; Stratum simply skips them per-calculation rather than making you scrub the file first.
Now look at a variable. Histogram flipper length and you don't get one bump — you get two. Body mass does the same. A distribution with two humps is a warning: you're looking at a mixture of different things stacked into one column, and the average is describing nobody.
Step 2 — The paradox, charted
Plot bill length against bill depth, one dot per penguin, and fit a line through the whole cloud: it slopes down (r = −0.24). Read literally, the chart says thinner bills are longer bills. You could ship that.
Now color the dots by species. The single blob shatters into three tidy clusters, and inside every one the trend flips positive:
| Species | bill length ↔ bill depth |
|---|---|
| Adélie | +0.39 |
| Chinstrap | +0.65 |
| Gentoo | +0.64 |
Within each species, a longer bill is a deeper bill — exactly as biology predicts. The negative pooled slope was never a fact about penguins; it's an artifact of mixing three species together. The long-billed-but-shallow Gentoos sit in the bottom-right, the short-billed-but-deep Adélies in the top-left, and lining up the three clusters drags the overall line the wrong way.
Step 3 — Every pooled correlation is suspect
A correlation matrix of the four measurements shows bill depth running negative against almost everything — bill length (−0.24), flipper length (−0.58), body mass (−0.47). All three are the same Simpson's effect: the big-bodied, shallow-billed Gentoos dragging depth the wrong way across the whole table.
But not everything is a mirage. Flipper length vs body mass = 0.87, and that one holds up inside each species too. The lesson: a correlation across mixed groups isn't wrong — it's answering a different question than the one you asked. It describes the arrangement of the species, not the biology inside any one. The fix is never a better statistic; it's to condition — look within the groups.
Step 4 — Are the species really different?
A one-way ANOVA of flipper length by species returns F ≈ 595, p ≈ 0, with an effect size of η² = 0.78 — 78% of all flipper-length variation is explained by species alone. Bill length: F ≈ 411, η² = 0.71. These are three genuinely distinct birds, and it isn't close.
But ANOVA answers "do the group averages differ?" — not "given one unlabeled bird, which species is it?" That gap, between description and classification, is the rest of this story.
Step 5 — A decision tree reads the species off a ruler
Predict species from the four measurements with a decision tree (Analyze ▸ Data Mining ▸ Decision Tree). Stratum sees a categorical response, grows a classification tree, and cross-validation-prunes it automatically. Its first question: is the flipper longer than ~207 mm? — which peels the big Gentoos off almost perfectly. Then it splits on bill length to separate the dainty Adélies from the long-billed Chinstraps. Penguin taxonomy, reconstructed from a ruler in three or four questions.
Set the yardstick first: always guessing the most common species (Adélie) is right 44% of the time. The tree, scored on held-out data, lands around 94% — more than double the baseline. The honest part is the confusion matrix beside it: Gentoos essentially never missed, Adélies caught almost every time, and the only real struggle is a few Chinstraps called Adélies — the two species genuinely overlap in bill depth.
A good model is confident where the data is clean and uncertain exactly where the data is ambiguous.
Step 6 — A forest pushes it to 98%
One tree is easy to read but brittle. A random forest (Analyze ▸ Data Mining ▸ Random Forest) grows a couple hundred trees on bootstrapped birds and lets them vote — and since each tree leaves out about a third of the data, you get validation for free (the out-of-bag estimate).
- OOB accuracy ≈ 98% — 98 birds in 100 identified from four measurements, unlabeled.
- ROC curves hug the top-left corner; AUC ≈ 0.997, near-perfect separability.
- Variable importance: bill length and flipper length carry most of it, bill depth adds the detail.
And the payoff that ties the whole thing together: feed the forest only the two measurements from the paradox — bill length and bill depth — and it still reaches about 96%. The exact pair whose pooled correlation pointed the wrong way is, together, almost enough to separate three species. The information was never missing; it was organized by group, and the aggregate hid it.
Step 7 — PCA finds the clusters with the label thrown away
The tree and the forest both knew the answer while they learned. PCA throws the label away and asks only: what are the real axes of variation?
- PC1 = 68.8% — loads on flipper length, body mass, and bill length together: an overall size axis.
- PC2 = 19.3% — loads heavily on bill depth: a bill-shape axis. Two components capture 88% of everything.
Plot every penguin on those two axes and color by species: three clean clusters fall right out, even though PCA was never told there were three species. A supervised forest and an unsupervised rotation agreeing on the same structure is how you know it's real — it's in the data, not in your method. And bill depth — the culprit from Step 2 — turns out to be an entire independent axis of a penguin, not noise. Pooling was flattening it.
What we actually did
Charts, a correlation matrix, ANOVA, a decision tree, a random forest, and PCA — the full arc of a classification problem, on real data, no code, about twenty minutes — turning "longer bills are shallower" into "there are three species here, and here's how to tell the next one apart with 98% accuracy."
Notice what we never needed: a dedicated discriminant analysis button. Modern trees and forests do that job and hand you a confusion matrix and ROC curves for free. That's the difference between a chart and an analysis.