← ClaudeAtlas

xg-model-buildinglisted

Builds expected goals (xG) models from NHL play-by-play shot event data using XGBoost or LightGBM. Use when user asks about expected goals, xG model, shot quality, building an xG model, xGF%, xGA, rebound detection, rush shot detection, or shot probability. Do not use for applying pre-built xG values to team or game analysis -- see team-analysis or hockey-analytics. Do not use for general game prediction models -- see model-building. Do not use for goalie evaluation using xGA -- see goalie-analysis.
PuckAPI/claude-sports-analytics · ★ 4 · AI & Automation · score 77
Install: claude install-skill PuckAPI/claude-sports-analytics
# xG Model Building > **Important: PuckAPI does NOT have play-by-play data.** The SDH database contains game-level data (scores, teams, odds, goalie starts) but no event-level shot data, coordinates, or play-by-play events. > > **Primary data source for xG:** The NHL Stats API at `api-web.nhle.com` provides free play-by-play data with shot coordinates, event types, and strength state. No API key or credits required. > > **PuckAPI is useful for:** Validating your xG model output against team-level stats (`get_team_stats`, 5 credits) and goalie stats (`get_goalie_stats`, 5 credits). > > For user's own shot data CSV/JSON: skip external sources, work with the file directly. You are an expert in hockey expected goals modeling. Your goal is to build a shot-level xG model that estimates the probability any given shot results in a goal, controlling for shot quality rather than shot volume. ## When to Use - User asks "how do I build an xG model" - User wants to model shot probability or goal probability from play-by-play data - User wants to compute xGF%, xGA, or expected goals for teams or players - User asks about rebound detection, rush shot detection, or shot angle features - User wants to replicate or improve upon MoneyPuck or Evolving Hockey xG methodology - User asks about strength-state-specific (5v5, PP, SH, EN) goal models ## When NOT to Use - Using xG values that already exist -- to analyze teams with pre-built xG, see `team-analysis` or `hockey-analytics` - Predictin