xg-model-building

Build expected goals models from NHL play-by-play shot events.

1|Updated May 5, 2026
One-click install
npx skills add https://github.com/sports-data-hq/hockey-skills --skill xg-model-building-sports-data-hq
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xg-model-building
Source: https://github.com/sports-data-hq/hockey-skills/tree/main/skills/xg-model-building
Command: npx skills add https://github.com/sports-data-hq/hockey-skills --skill xg-model-building-sports-data-hq

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you build an expected goals model for hockey shot data, so you can estimate shot quality instead of relying on shot volume alone.

Core Features & Use Cases

  • Shot-Level Probability Modeling: Converts play-by-play shot events into goal probability estimates using location, shot type, strength state, and event context.
  • Feature Engineering Guidance: Shows how to derive rebound, rush, angle, and distance-based features from NHL play-by-play data.
  • Model Training and Validation: Explains how to train separate strength-state models, evaluate calibration, and aggregate shot-level xG into team-level xGF and xGA.
  • Use Case: If you want to replicate public xG models or validate your own shot data pipeline, this Skill gives you the methodology and guardrails to do it correctly.

Quick Start

Ask the xg-model-building skill to help you turn NHL play-by-play shot events into a calibrated expected goals model with rebound, rush, and strength-state features.

Frequently Asked Questions about xg-model-building

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an expected goals model from NHL play-by-play data?

An expected goals model converts NHL play-by-play shot events into goal probability estimates using event coordinates, shot type, rebound and rush features, and strength state to quantify shot quality accurately.

What features do I need for hockey shot quality modeling?

Hockey shot quality modeling requires event coordinates, shot type, rebound flags, rush indicators, and angle or distance metrics derived from play-by-play data to accurately estimate goal probability.

Why do I need separate expected goals models for different strength states?

Separate strength-state models are needed because shot quality and game dynamics shift significantly between even strength and power play situations, requiring distinct calibration checks for accurate team xGF and xGA aggregation.

Can I use xgboost for hockey expected goals calibration?

Yes, xgboost is commonly used to train expected goals models on hockey shot data, requiring subsequent calibration checks to ensure the predicted goal probabilities align accurately with actual outcomes.

How do I aggregate shot-level xG into team xGF and xGA metrics?

You aggregate shot-level xG into team metrics by summing the individual goal probability estimates for all shots taken and allowed, creating team-level expected goals for and expected goals against totals.

What are the limitations of using shot volume instead of expected goals?

Relying on shot volume ignores shot quality context like location, shot type, and rebound or rush situations, leading to skewed evaluations, whereas expected goals weights these factors to provide a true performance measure.