Zero Sum Labs

Next.jsReactPythonpandasSupabaseRaspberry PiView Site

Automated regression-based sports ratings and game projection platform

Zero Sum Labs is an automated sports analytics platform that calculates offensive, defensive, and overall team strength and generates game projections across multiple professional sports leagues.

Components

The Ratings Engine

Every team receives a net rating comprised of their offensive and defensive ratings which are calculated seperately using iterative fitting against real game results. The league average rating is anchored at zero and the ratings react to game results in real time accounting for home field advantage and strength of schedule.

Automated Data Pipeline

The whole platform is automated. Every morning, Python scripts on a Raspberry Pi fetch the results of the previous day's sports games, parse and normalize all of the results, feed the results into our ratings engine, and the updated ratings and future game projections are published to a Supabase database. Then, the Next.js frontend displays the ratings from the database at zsl.coopercharles.me.

The Platform

League Rankings

Every sport has a league ratings table. The table shows every team alongside their record, net rating, offensive ratings, and defensive rating. The table also shows where every team ranks among the league in those categories.

Team Profiles

Every single team has a profile page accessible by clicking the team name from the rankings table or by searching for them with the search bar. The profile page shows all the info from the rankings page as well as a rating trajectory chart, which shows how the team has improved or regressed over the course of the season. It also shows the projection for the team's upcoming game.

Game Projections

A projections page shows the simulated results of every upcoming game including scores, win probabilities, and game totals. The projections page is filterable and allows the user to select any day to view.

Challenges

Early Season Ratings

In a traditional model, early season games would carry a large weight on ratings because of a limited sample size. Our model includes a pre-season prior based on the previous season's result that slowly fades out as the season goes on. This helps our model stay accurate and grounded at any point during the season.

Cross-sport Modeling

Every sport is different, but one thing that remains consistent is every team in every sport is trying to score as much as possible and limit opponent scoring as much as possible. Using those key factors as the basis of our model allows us to maintain a similar model across every sport, with only minor adjustments between sports.

Interpretability

Sometimes sports analytics can be difficult to digest and understand. That's why the ratings on Zero Sum Labs have a very intuitive meaning. Each rating is just how much more a team scores per game than league average. For example, a +1.50 offensive rating means that team scores 1.5 more points than average.

Screenshots

Rankings table for the NHLTeam profile for Nashville SCUpcoming game projections for today