Case Study 1 — Rebuilding the 2023 Open from Incomplete Scorecards (REAL data)

Script: code/case_study_01.py. Data: the ESPN PGA TOUR snapshot via golfkit.data (The Open 2023, Royal Liverpool, event 401465539), plus ESPN's raw scoreboard file for that week.

Setup

The chapter opened with the 2023 Open, where the first-pass build named the wrong champion. Here we go further. Suppose you want to use this event in three analyses: a leaderboard for a "major winners" table, the cut line for a model of cut rules, and a hole-by-hole difficulty table for a course-history study. In the earlier versions of this book's build, the event's hole data looked badly incomplete. Which of the three analyses could you still do honestly then, what was actually wrong, and what does the final build show?

This is the situation every analyst meets eventually. The data aren't missing completely, which would be easy to spot and to drop. They are missing partly, and that is much more dangerous, because partial data still produce numbers. This case has a twist that makes it more useful still: the missing data turned out to be our own pipeline's doing.

Before: what the earlier build saw

Before the build's label fix (§2.4), the event-level flags told a worrying story. Only 58.8% of the event's round rows were complete 18-hole scorecards, and if you trusted the build's labels, 54.5% of the field "withdrew". The event failed golfkit's quality screen (quality_ok False, against thresholds of at least 90% complete and at most 25% WD/DQ). It stayed stroke_play_ok, because its complete rounds were still good for strokes gained.

By round, the earlier build had complete scorecards for 85 of 156 players in rounds 1 and 2, 50 of 76 in round 3 and 53 of 76 in round 4. Most incomplete scorecards were short by one to four holes. Every player still had ESPN's round score for every round he played. Only the hole-by-hole detail was patchy.

These are the four checks that the earlier version of this case study ran on that data, with what each one found:

Check (earlier build) What it found
Leaderboard from round scores and ESPN's order Recoverable: Harman 271, four players tied second on 277. But Sepp Straka and Rory McIlroy had no complete scorecard all week, so any rule that needed complete scorecards erased the top of the leaderboard.
The cut, two ways infer_cuts got the line right (145) but said 40 made the cut, because it counted only complete round-3 scorecards. ESPN's round scores showed 76.
Hole table Built from only 273 complete scorecards out of 464 rounds played. Hardest hole: the 14th at +0.344.
Complete-scorecard players vs the rest In round 1 the complete-scorecard players averaged 72.80 against 73.79 for the rest, a gap of about a stroke. A hole table built from them understated how hard the course played by 0.20–0.45 strokes per round in rounds 1, 2 and 4.

The verdicts were: leaderboard recoverable, cut recoverable with care, hole table not trustworthy. And the case study ended on a warning: we don't know why the scorecards went missing; don't invent a cause.

Finding the cause

It turned out the cause could be found, by going back to ESPN's raw JSON instead of our processed tables. The script scans every hole record in the raw scoreboard file for that week and applies the build's own test: does the to-par tag imply a par of 3, 4 or 5?

Raw ESPN hole records: 8,352; with an unusable to-par tag (implied par outside 3-5, or OTHER): 943, on 206 player-rounds (93 players)
  by round: {1: 75, 2: 76, 3: 29, 4: 26}
  commonest (strokes, tag) pairs: [("5 strokes tagged '-1'", 364), ("3 strokes tagged '+2'", 199), ("4 strokes tagged '+2'", 174), ("2 strokes tagged '+2'", 72), ("6 strokes tagged '-3'", 50)]

ESPN had every hole's strokes. What it got wrong that week was the to-par tag on 943 of 8,352 hole records. A 5 tagged "−1" implies a par 6. A 3 tagged "+2" implies a par 1, and a 2 tagged "+2" implies a par of zero. The book derives par as strokes minus the tag (§2.2), so every one of those records produced an impossible par. The earlier build read the 5-tagged-"−1" records as phantom par 6s (the quirk that §2.5 once counted). It set the others aside, and that left their scorecards short of 18 holes. The affected player-rounds by round (75, 76, 29, 26) are close to the earlier build's count of incomplete scorecards (71, 71, 26, 23). They are not identical, because the phantom par 6s were kept, so those rounds still counted as complete.

The final build no longer trusts a tag that makes no sense. It treats any unusable tag (OTHER, or an implied par outside 3–5) as "par unknown". Then it reads the par from what the other players in the same round recorded on that hole (§2.4). The strokes were right all along, so nothing about any player's score is changed.

Were the affected rounds a random sample? The script compares round scores for rounds that carried at least one unusable tag with rounds that carried none:

               count   mean   std
round bad_tag
1     False       81  72.67  3.13
      True        75  73.88  3.53
2     False       80  73.01  2.97
      True        76  73.91  3.83
3     False       47  70.30  2.55
      True        29  70.66  2.84
4     False       50  72.26  2.91
      True        26  73.19  3.56

The rounds with a bad tag were worse by 1.21 strokes in round 1, 0.90 in round 2, 0.36 in round 3 and 0.93 in round 4. That is the same direction the earlier build saw, and now we know which rounds were involved and why they were short. We can show that the bad tags fell more often on worse rounds. We can't see inside ESPN's system to say why its tags went wrong, so we stop there.

After: the final build

1. The scorecards

The Open 2023 (Royal Liverpool GC): field 156, share_complete 1.000, wd_share 0.000, quality_ok True, stroke_play_ok True

Round rows and complete 18-hole cards in the final build
       rows  complete_cards  holes_mean
round
1       156             156        18.0
2       156             156        18.0
3        76              76        18.0
4        76              76        18.0
Holes recorded on incomplete cards: {}

Every round of the 2023 Open now has a complete 18-hole scorecard. The event passes the quality screen, and the "withdrawals" are gone.

Figure CS1.1 — 2023 Open after the label fix: every round has a complete scorecard

📊 Figure (described): Paired bars for each of the four rounds. Blue bars count rounds played (156, 156, 76, 76) and orange bars count rounds with a complete 18-hole scorecard in the final build. The orange bars are exactly as tall as the blue ones, and each is labelled 100%. In the earlier build the orange bars stood at 85, 85, 50 and 53.

2. The leaderboard

 position_fixed         name  total_fixed  to_par
            1.0 Brian Harman        271.0   -13.0
            2.0      Tom Kim        277.0    -7.0
            2.0    Jason Day        277.0    -7.0
            2.0  Sepp Straka        277.0    -7.0
            2.0     Jon Rahm        277.0    -7.0
            6.0 Rory McIlroy        278.0    -6.0

The leaderboard is the same as before, because it never depended on hole scorecards. ESPN's round scores were complete all along. The difference is that the leaders' scorecards are now complete as well:

round            1     2     3     4
name
Brian Harman  True  True  True  True
Tom Kim       True  True  True  True
Jason Day     True  True  True  True
Sepp Straka   True  True  True  True
Jon Rahm      True  True  True  True
Rory McIlroy  True  True  True  True

3. The cut

Inferred cut: [{'cut_round': 2.0, 'n_made_cut': 76.0, 'cut_line': 145.0}]
From ESPN round scores: 76 played round 3 (36-hole totals 132–145); 80 did not (best 146). status_fixed: 80 MC, 76 finished

The general-purpose inference now agrees with the round scores: a 145 line, with 76 making it. In the earlier build infer_cuts said 40, and only the second method revealed the error. This is still why the outcome-based evaluations in Part VI exclude any event that fails quality_ok rather than trust a single inference on it. Three usable events still fail the screen: the 2004 PGA Championship, the 2005 Shell Houston Open and the 2019 RBC Canadian Open.

4. The hole table and round difficulty

Hole table built from 464–464 cards per hole (of 464 rounds played); hardest three:
 hole  par  yards   n   avg  to_par
   14    4  454.0 464 4.347   0.347
    1    4  459.0 464 4.280   0.280
   10    4  507.0 464 4.250   0.250
Field average by round, all scores vs complete-card players only: {1: (73.25, 73.25), 2: (73.45, 73.45), 3: (70.43, 70.43), 4: (72.58, 72.58)}

The hole table now uses all 464 rounds rather than 273. The 14th is still the hardest hole, at +0.347 against the earlier +0.344. The ordering at the top survived, but the earlier table was resting on a better-than-average subset. The field average by round is now identical whether you use every round score or only complete scorecards, because they are the same rounds. In the earlier build, the subset understated round 1 by 0.45 strokes (72.80 against 73.25). That is small next to a single player's round-to-round spread (an SD of 2.756 strokes on tour). But it is larger than many effects later chapters care about. For example, the out-of-sample gain from course fit in Chapter 33 is at most about 0.0015 strokes per round of prediction error.

Verdict, final build: all three analyses are usable for the 2023 Open. In the earlier build, the hole table was not.

An audit routine you can reuse

Pulling the steps together gives a routine worth running on any event before you lean on it:

Step Check Earlier build Final build
1 Share of complete scorecards per round 54–70%, far below the 90% screen 100%
2 Leaderboard from round scores and the corrected columns, against ESPN's order Correct, but the raw rule would have erased 7 of the top 8 Correct; every leader has complete scorecards
3 The cut from two methods: inferred rule vs who actually played round 3 Line 145 agrees; made-cut count 40 vs 76 145 and 76 from both
4 Complete-scorecard subset vs all rounds, by round Subset 0.20–0.45 strokes better than the whole field in rounds 1, 2 and 4 Identical
5 Go back to the raw source: do the raw records explain the gap? (not run) 943 hole records with impossible to-par tags on 206 player-rounds

Steps 1–4 need nothing beyond golfkit.data and a few lines of pandas: filters, a groupby, a merge. Step 5 needs the raw JSON and the json module from §2.2. The habit matters more than the code. In Parts VI and VII, when you evaluate a betting or fantasy model over hundreds of events, nobody will look at each event by hand. So the screen has to be automatic (quality_ok), and you have to know what it is protecting you from. This case is what it protects you from.

What it means (and doesn't)

  • It means that partial missingness is worse than total missingness, because it still produces numbers. In the earlier build the 2023 Open gave a leaderboard, a cut and a hole table, and only the first two survived scrutiny.
  • It means "missing" has a direction. The rounds that lost holes belonged to players who scored about a stroke worse in three of the four rounds.
  • It means a cross-check can find a cause, not just a symptom. Round scores against hole sums, the inferred cut against round-3 participation, the subset average against the full average: each one pointed at the same rounds. Going back to the raw records then showed why they were short.
  • It means your own pipeline is a suspect. ESPN's file held every stroke. The holes went missing because our rule for reading the to-par tag couldn't cope with tags that made no sense.
  • It doesn't mean ESPN's data are bad in general. The 2026 Masters, checked the same way in §2.6, had 290 complete rounds out of 290 and zero par or sum mismatches. Three events fail the quality screen out of 1,031 usable ones.
  • It doesn't tell us why ESPN's tags went wrong that week. We can see the pattern and its effect, not ESPN's internals. Don't invent a cause.

Discussion questions

  1. In the earlier build, the incomplete-scorecard players scored worse in rounds 1, 2 and 4 but barely in round 3. The raw scan shows the same pattern for rounds with a bad tag. Suggest two mechanisms that could produce it, and say what data would tell them apart.
  2. Before the fix, should this event's complete rounds have stayed in the strokes-gained model? Argue both sides. Consider whether the 85 complete round-1 scorecards were "fine" once each round is compared only within its own course-round.
  3. A colleague had proposed filling each missing hole with the field's average score on that hole. What would that have done to the hole table, and to round totals? Why is the final build's approach (keep the real strokes, recover only the par) better?
  4. The final build recovers par from the other players' scorecards on the same hole. When could that go wrong? Think of multi-course events, and of a hole whose par changed between rounds.
  5. Which of this case's checks would you automate for every event, and which would you run only when an event fails quality_ok?

Your turn

Pick one of the events that still fail the quality screen: the 2004 PGA Championship, the 2005 Shell Houston Open or the 2019 RBC Canadian Open. Run the same steps by adapting code/case_study_01.py: (1) the share of complete scorecards by round; (2) the corrected leaderboard and how many leaders have complete scorecards; (3) the cut from round scores against infer_cuts; (4) the complete-vs-incomplete score comparison; (5) a scan of the raw scoreboard file for that week. Is the gap ESPN's or the pipeline's? Write a three-line verdict for each analysis: leaderboard, cut, hole table.