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:
@@ -64,28 +64,29 @@ function classifyArsenal(pitchMix) {
|
||||
}
|
||||
|
||||
/**
|
||||
* hitterProfile(batterRow) — the aggregate tendencies we DO have. gb/fb lean
|
||||
* comes from gb_pct_bb vs fb_ld_pct in the metrics blob (batted-ball type).
|
||||
* hitterProfile(batterRow) — the aggregate tendencies we DO have.
|
||||
*
|
||||
* FLY-BALL lean comes from avg_launch_angle (league p10/p50/p90 = 7.1/13.9/20.1°
|
||||
* verified in prod). NOTE: the metrics blob's `gb_pct_bb` / `fb_ld_pct` are
|
||||
* mislabeled — they are EXIT VELOCITIES by batted-ball type (Judge fb_ld_pct =
|
||||
* 100.3 mph, not a rate), NOT ground/fly RATES. Launch angle is the correct,
|
||||
* unambiguous air-vs-ground signal. (Caught in the proj-v1 sanity induction.)
|
||||
*/
|
||||
function hitterProfile(row) {
|
||||
if (!row) return null;
|
||||
const m = row.metrics || {};
|
||||
const gb = num(m.gb_pct_bb);
|
||||
const fb = num(m.fb_ld_pct);
|
||||
let flyLean = null;
|
||||
if (gb != null && fb != null && (gb + fb) > 0) flyLean = fb / (gb + fb); // 0..1, high = fly-ball
|
||||
return {
|
||||
whiff: num(row.whiff_pct) ?? num(m.whiff_pct),
|
||||
chase: num(row.chase_pct) ?? num(m.chase_pct),
|
||||
hard_hit: num(row.hard_hit_pct) ?? num(m.hard_hit_pct),
|
||||
fly_lean: flyLean, // fraction of batted balls in the air
|
||||
launch_angle: num(row.avg_launch_angle) ?? num(m.avg_launch_angle), // ° — higher = more air
|
||||
};
|
||||
}
|
||||
|
||||
// League anchors (2026 percentiles, verified in prod) — the neutral point each
|
||||
// tendency is measured against, so "high"/"low" means relative to the league.
|
||||
const ANCHOR = Object.freeze({
|
||||
arsenal_whiff: 22, hitter_whiff: 24, hard_hit: 38, fly_lean: 0.5,
|
||||
arsenal_whiff: 22, hitter_whiff: 24, hard_hit: 38, launch_angle: 13.9,
|
||||
});
|
||||
// Max single-component lean and total matchup lean — coarse read, small effect.
|
||||
const COMP_MAX = 0.05;
|
||||
@@ -118,7 +119,7 @@ function matchupMultiplier({ arsenal, hitter, statType } = {}) {
|
||||
// fly-ball arsenal lets a fly-ball hitter elevate. DERIVED: sinker share
|
||||
// vs hitter fly lean.
|
||||
const groundy = clamp(arsenal.sinker_pct - 0.20, -0.5, 0.6) / 0.6; // >20% sinker = groundy
|
||||
const flyBat = z(hitter.fly_lean, ANCHOR.fly_lean, 0.2);
|
||||
const flyBat = z(hitter.launch_angle, ANCHOR.launch_angle, 6); // p90 20° → ~+1, p10 7° → ~-1
|
||||
const airSuppress = clamp(groundy * Math.max(0, flyBat), -1, 1); // groundy arm vs fly bat → power down
|
||||
|
||||
// (3) HARD-CONTACT axis — an arsenal that allows hard contact, faced by a
|
||||
|
||||
Reference in New Issue
Block a user