proj-v1 sanity fixes (caught in the real-data induction)

1. matchupRead fly-ball signal: the batter metrics `gb_pct_bb`/`fb_ld_pct` are
   MISLABELED — they're exit velocities by batted-ball type (Judge fb_ld_pct =
   100.3 mph, not a rate), not ground/fly RATES. Switched fly-ball lean to
   avg_launch_angle (league p10/p50/p90 = 7.1/13.9/20.1°), the correct signal.
2. Absolute rate now fits the FULL season (recency-weighted), not a 20-game
   window: the window under-sampled rare stats — Judge HR projected 0.11 vs his
   0.28 season rate (a fake -32pt edge). Now point=0.27 (matches season); the
   last-5-2x recency lean is preserved.

Post-fix induction (real statsapi logs + real statcast): Judge HR 0.27 (P>=1
0.235 vs book 0.42 -> flags the juiced over), Judge TB P>=2 0.548 vs 0.48
(+6.8pt), thin-hot 3-game P>=1 0.726 / P>=3 0.164 (credible low, thin high),
.300 hitter != 3.0. proj-v1 suites 23/23.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCNgGSt5qvcLxaeQqa7Zpj
This commit is contained in:
Kev
2026-07-23 04:05:23 -04:00
parent 6386e737b9
commit 316b79733e
3 changed files with 21 additions and 15 deletions
+8 -3
View File
@@ -87,9 +87,14 @@ function parkBaselineFromLogs(gameLog, playerTeamAbbr) {
return factors.reduce((a, b) => a + b, 0) / factors.length;
}
/** Recency-weighted observed counts (last-5 games weighted 2×, like the champion). */
function recencyWeighted(gameLog, field, window = 20) {
// gameLog is most-recent-LAST (statsapi order); take the tail as recent.
/**
* Season-with-recency observed counts: the FULL season anchors the absolute rate
* (a 20-game window under-samples rare stats — a slugger's HR drought produced a
* 0.11 point vs a 0.28 season rate, a fake -32pt edge, caught in the induction),
* with the last 5 games weighted 2× for current form (as the champion does).
*/
function recencyWeighted(gameLog, field, window = 200) {
// gameLog is most-recent-LAST (statsapi order); the tail is the recent form.
const rows = (gameLog || []).filter((g) => g && g.stat);
const recent = rows.slice(-window);
const n = recent.length;