Key Takeaways — Chapter 31: Chess Database Analytics
Key Takeaways
- Say exactly what you mined. The book's snapshot is 4,471,751 games (4,000,000 Lichess, 373,918 broadcast rows, 97,833 master games); with 6,193,530 puzzles, 10,665,281 records. The Lichess sample is 34.2 hours of one Thursday and Friday — not a year, not a panel.
- Every filter is an assumption — and some move the answer a lot. Bots, engine events (50.0% draws), online events (6.4% draws) and unbalanced pairings (White 68.5% vs 34.2%) are different populations. Balancing the OTB set raises its draw rate from 25.7% to 34.6%.
- Who plays an opening is part of its score. Across 25 Lichess families, raw and Elo-expected scores correlate at 0.74; OTB raw White scores span 48.9–59.4% but rating-adjusted scores only +2.0 to +4.3. Compare openings by rating-adjusted score in balanced games.
- Query positions, not names. 70.6% of Lichess games reaching the QGD Exchange position arrived by transposition (London 63.6%; Italian 7.1%). Index once, match exact order and transpositions, and validate against a known table (our engine reproduced the reference Italian row exactly).
- The next-move table explains the score. The Scotch scores well at club level largely because Black's most common reply, 4...Nxd4 (43.0% of Lichess replies), concedes +0.76 (Stockfish 19, depth 20) — a move strong players almost never choose.
- Weight designed samples; distrust self-selected ones. Weighted, the move-text subset recovers the 4M truth to within 0.3%; unweighted it misstates the bullet share (29.5% vs 35.9%); "analysed games only" is badly biased (20.7%).
- The definition is the finding. "One pawn up at the endgame start" wins 41.6%, 46.0% or 46.1% at OTB 2400+ depending on the definition; the median engine eval of those positions is +0.40 at 2400+ vs +1.80 at 1400–1599, and within an eval bucket conversion rises with rating.
- Frequency is not quality. Knights stand on f3 in a third of OTB games with owner_adj +0.1; the best-scoring squares are rare (d6 +5.6, 0.36% of games), and back-rank squares measure captures, not squares.
- Beware reverse causality. Low-clock players score 16–18 points below expectation partly because they were losing. Early time use (a pre-outcome measure) costs points at 3+0 even from equal positions, but not measurably at 10+0.
- Replicate before you believe. In the full opening table 42 of 63 findings replicated in the other half; on a 2% subsample, none of 10 did. Extremes shrink toward the mean.
Principles & Metrics
| Metric / principle | Definition | Use it for |
|---|---|---|
| Score | (wins + ½ draws) / games, from a named side | any result comparison — always with n |
| Elo-expected score | 1/(1+10^((R_opp−R_own)/400)) per game, averaged | what the ratings predict |
| Rating-adjusted score (adj) | score − expected, in points | comparing openings/groups with different players |
| Balanced games | |rating difference| ≤ 100 | opening and structure statistics |
| Wilson 95% interval | interval for a proportion (draws as half points) | every reported score |
| Sample weight | 1 for analysed Lichess games, 8 for others in the move-text subset | any Lichess population estimate from game_features / move text |
| Kish effective n | (Σw)² / Σw² | intervals for weighted data |
| Transposition share | transpositions ÷ all games at a position | deciding whether a move-order search is good enough |
| Settled endgame start | first endgame ply whose next move is not a capture | conversion statistics (matches replay-based tables within a point) |
| Split-half replication | significant in A and B with the same sign | any mined table with many cells |
Common Mistakes (and the fix)
| Mistake | Fix |
|---|---|
Filtering bots with != "BOT" (drops untitled humans) |
chessdata.is_bot_game(df); print the count after each filter |
| Reading a family's raw score as its value | Balanced games, rating-adjusted score, intervals |
| Searching by move order in a set-up opening | Position query with transpositions |
| Computing Lichess averages from the move-text subset unweighted | weight="sample_weight" and Kish n |
| Calling analysed-game statistics "Lichess averages" | Label them "analysed games" — weights cannot fix self-selection |
| Treating "one pawn up" as a fixed advantage | Check the settled definition and the engine evaluation |
| Ranking 200 cells and quoting the top and bottom | Split-half replication, multiple-comparison correction, shrink extremes |
| Using end-of-game clock statistics as causes | Pre-outcome predictors, control for the position |
Decision Checklist (before you trust or quote a database number)
- [ ] Which games? Source, time window, filters, n — printed.
- [ ] Who played them? Balanced? Rating-adjusted? Same pool (Lichess vs FIDE) on both sides of the comparison?
- [ ] Which definition? Opening name or position? Which ply is "the endgame start"? Which clock measure?
- [ ] Weighted? If the data came from the move-text subset, did you use the weights and Kish n?
- [ ] How wide? Intervals on both sides of the comparison (yours and the database's).
- [ ] Replicated? Split-half, another month, or another pool.
- [ ] Why? Next-move table and a Stockfish 19 evaluation at a stated depth for the positions behind the number.