The Hockey Code is a Canadian-based start-up in the Hockey analytics Sector. We strive to bring Hockey Analytics to the Future using Machine Learning. This is an endeavour of passion that is all about bringing value to hockey, with a particular focus on asset management, contract and negotiation optimization of the salary cap. First lines of codes and vision written in Montreal two years ago.

What data is used?

  • Player data: Game by game data files from
  • Contract data: Capfriendly and

How did was THC built?

  • Quant Finance and Deep Data learning
  • Expertise in financial product comparison and product building – I’m an Account Executive at
  • Passion for stock trading, sports management, code and entrepreneurship

How is a player’s valuation calculated? Every player has a Fair Market Value (FMV).

  • Built a Hockey Stock Market App with the help of friends who innovate at the cutting edge of hockey analytics, quant finance and product building.
  • The objective of the model is to evaluate performance and generate a dollar value for the player and goalies’ on-ice output.

How do we value Player Performance? We determine player performance with the Game Score (GS) variable.

  • Ranges between 0 and 1.
  • The more your performance moved the needle, the higher the GS.
  • Impactful players performance will yield a GS closer to 1. Unmemorable performances will yield a 0
  • For example, Patrick Laine rookie night, he generated a GS of 0.27 and $146k in FMV. Last season, Laine’s best night he generated a GS of 0.99 and $529k in FMV(GameID 2017021114). Laine has consecutive seasons with 5 games with a GS over 0.90.

Over 90 variables are used to generating a player GS.

An objective/assumption of mine was to have enough variables that can cause a GS to be volatile on a game by game basis. Just like the Stock market, players value can move 0.0% or +/- 200% in a matter of games.

How reliable is the Data?

In testing, the Keras model recorded a Log Loss of 0.2011 and a Brier score of 0.0972 on out-of-sample data. For reference, the No Information Rates (NIR) obtained by simply assuming that every player has a probability in each class equal to the average probability are 0.3604 and 0.1483 respectively. The Brier score of 0.0972 is also a moderate improvement on the score recorded by the previous model outlined in the blog post (0.098).

Would I recognize stats that have been used in the model?

  • Yes, we start with a 5-on-5 component …

# 5-on-5 Time On Ice

# 5-on-5 Goals

# 5-on-5 primary Assists

# 5-on-5 secondary Assists

# 5-on-5 individual shot attempts

# 5-on-5 individual shots on goal

# 5-on-5 individual blocked shots

# 5-on-5 individual Giveaways

# 5-on-5 individual Takeaways

# 5-on-5 individual minor Penalties taken

# 5-on-5 individual minor Penalties drawn

# 5-on-5 individual Hits

# 5-on-5 individual Face-Offs won

# 5-on-5 individual Face-Offs lost

  • + add a Possession component…

# 5-on-5 on-ice Corsi For %

# 5-on-5 on-ice Goals For %

# 5-on-5 on-ice Goals For

# 5-on-5 on-ice Goals Against

# 5-on-5 off-ice Corsi For %

# 5-on-5 off-ice Goals For %

  • + add a contextual and advanced stats component…

# On-ice Goals For

# On-ice Goals Against

# Off-ice Corsi For %

# Off-ice Goals For %

  • + add an Impact component – perhaps the most exciting part in my opinion – because at the end of the day, hockey is a pro sport and the NHL is a result driven business.

# Did the player’s team win? (1, 0)

# Did the player score the Game-Winning Goal? (1, 0)

# Most Points in the game by any player

# Most shots on goal in the game by any player

# Second-most Face-Offs won in the game by any player

# Third-most Hits in the game by any player

# Most Goals in the game by a player on the same team

# Second-most Goals in the game by a player on the same team

# Third-most Face-Offs won in the game by a player on the same team

  • Goalies deserve love, and we build a GS for them too!

# Is the player the winning goalie? (1, 0)

# Is the player the losing goalie? (1, 0)

# 5-on-5 Save %

# 5-on-5 Fenwick Save %

# 5-on-5 Shots on goal Against

# 5-on-5 Goals Against

# Save %

# Fenwick Save %

# Shots on goal Against

# Goals Against