Super Bowl LVII is fast approaching and the excitement is starting to build. As we near one of the largest (and highly anticipated) events in American sports, we can’t help but consider the question on everyone’s mind: Which team will come out on top?
While we anxiously await the big game, let's harness the power of Dataiku and the Elo rating system to make a data-driven prediction. Who’s ready for some football? Sit back, grab your game-day snacks, and let’s see who the data predicts will emerge victorious.
Using the Elo rating system
One popular way of ranking teams and predicting the outcome of future matchups is by using the Elo rating system. While the Elo rating system originated as a chess-rating system, it has countless applications including its current use for many online video game rankings. It was also part of the NCAA College Football BCS rating system from 1998-2013. One additional element of Elo ratings is that it can help forecast who may win a game even if the opponents have never played against each other.
If you aren’t familiar with the Elo rating system, here’s an overview of how it works. Each player (or team) starts with a set of points (we will use 1600 since it’s is common for sports Elo setups). Each player (team) wagers some points for each game that takes place and the winner receives most of the wagered points after the match following a mathematical function. If a highly ranked team faces a much lower ranked team (suppose one team has an Elo rating of 1650 and another has a 1550 rating), then the higher ranked team has a higher likelihood of winning and will get fewer additional points with a win but lose more points with a loss.
One nuance to note is the element of home field advantage. Most sports Elo rating systems boost the home field’s Elo rating by 100 points to represent home field advantage. This is what we will use in our example. This means that unless the Away Team has an Elo rating 100 higher than the Home Team, the Home Team will have a higher forecasted likelihood of winning. 100 points is quite substantial and it generally works out that with a 100-point difference, the team with a higher rating is expected to have a 64% chance of winning vs. 50% at a neutral site. Additionally, the super bowl (along with a few regular season games) are played at a neutral site so the Elo model for the NFL has to account for the “Home Team” not actually having home field advantage.
Building the NFL Elo Rating System in Dataiku
Starting with a blank project, we can quickly build the Elo rating system thanks to readily available open source information regarding sports. We chose to use the NFL scores and betting Kaggle data as a source because it has all of the NFL scores since 1966 readily available along with details of the home team, stadium that the game was played at, weather, etc. Through the power of Dataiku, we easily pulled in the CSV files and continued building the model.
A quick review of the CSV file “spreadspoke_scores” showed us that the dataset needed to be parsed which was an easy Dataiku prep step. The date parsing was needed for the Elo rating Python code (next step in the flow) to understand the dates from the Kaggle data, sort the games in chronological order, and identify future games to predict.
With the prepped data, we were then able to build the Elo rating model in Dataiku using a Python code recipe. Elo rating code samples from Elopy provided a great starting point for establishing our Elo rating for NFL teams. We added some additional code regarding when to start the Elo ratings so it didn’t begin with all the games since 1966. We decided to start at the beginning of the 2022-2023 NFL season since a team’s performance in any given year generally seems independent from the previous year.
We chose to write the Elo results to an output dataset and have the prediction for upcoming games as a separate dataset. The upcoming game predictions include both the expected spread and the percentage chance that the Home Team wins. Negative numbers in spread imply the “Home Team” is forecasted to win, while a positive number implies that the “Away Team” is forecasted to win. The terms “Home Team” and “Away Team” are put in quotes as they are extraneous terms for the super bowl as it is played at a neutral site. The only significance is seeing which team is considered Home vs. Away to interpret the results. In the case of our model, the Eagles are entered as Home.
Considering the nuance of home field advantage for all but 6 games this season, we also modified the Python script to not boost the Home Team’s Elo rating when the game is played at a neutral site.
Say “Elo” to Our Predicted Winner
Running the Elo rating system for the 2022-2023 season within Dataiku and opening the “upcoming_game_probabilities” shows that the Elo rating model predicts the Philadelphia Eagles to win Super Bowl LVII…but it just barely favors them. The expected margin of victory is .04 points (yes, less than 1 point). The Eagles are forecasted to have a 50.2% chance of winning based on the Elo model.
This is a very small margin because the Eagles and the Chiefs have almost the same Elo rating going into Super Bowl LVII – The Eagles have an Elo rating of 1693.71, and the Chiefs at 1692.59.
Comparing Recent Dataiku Elo Model Performance
Could this prediction be correct? Let’s compare how the model has been performing so far. Our model predicted that the Chiefs would beat the Bengals in the AFC Championship (3.7 point spread with 64% chance of a Chiefs win) and that the Eagles would win the NFC Championship (2.9 point spread with 61% chance of a Eagles win). Those both turned out to be correct with the Chiefs beating the Bengals by 3 points with the 23-20 final score and the Eagles beating the 49ers by 24 points with the 31-7 final score.
In the case of the AFC Championship, the Chiefs and Bengals had very similar Elo ratings – within 3 points (1688.91 for the Chiefs vs. 1686.21 for the Bengals) – after the entire regular season and playoff games leading up to the Championship week. The model provided a 100-point Elo boost for the Chiefs since they were playing at home for the AFC Championship, and that Home Field Advantage boost was more than enough for the Chiefs to be favored.
In the case of the NFC Championship, the 49ers actually had a higher Elo rating (the 49ers had the highest Elo rating of all teams going into Championship week) than the Eagles by almost 20 points (1699.08 for the 49ers, 1680.24 for the Eagles). However, the Eagles playing at home with Home Field Advantage still made the Elo model favor the Eagles.
Alternate Scenarios for Super Bowl LVII
While exploring alternatives for this forecast, we changed the model’s start date to October 18 – right after Week 6 of the regular season – expecting that the Chiefs would be rated higher since they only lost one game after Week 6. The Chiefs did indeed get a better Elo rating, and the Chiefs switched to being favored by .32 points and having a forecasted 51.3% chance of beating the Eagles.
But it would hardly be fair to boost the Chiefs by starting after Week 6, when the Eagles have losses in Weeks 16 and 17 with Jalen Hurts out for those games. Re-running the model with those two games for the Eagles not considered (deleted from the data set) provides a forecast of the Eagles being super bowl favorites by .67 points which is quite a bit higher than the originally estimated .04 point margin of victory. The Eagles then have a forecasted 52.7% chance of beating the Chiefs which is the highest percentage forecasted for either team in all of our scenarios.
Don’t Bet the Farm on the Elo Model
In the NFL, anything can happen during any given week. While we’ve had a lot of fun preparing this Elo rating model, it’s best to steer clear of putting all your eggs in one basket when it comes to relying on its prediction. This model works quite well for games depending on individual performance, but there are complexities with team sports – especially ones with significant variation like NFL football and its related injuries. While an individual playing chess may have a bad night’s sleep or a headache that affects their individual gameplay in one day, it’s not nearly as varied as the week-to-week variation in the NFL. Afterall, who would have thought that the 49ers would win 6 straight games to end the season and go to the NFC Championship with their 3rd string Quarterback? Additionally, when two teams have an Elo rating difference of about 1 point after 17 regular season games and 2 playoff games and the model forecasts less than a 1 point spread, its really quite far from a sure thing.
Using the Elo Model in Parallel Use Cases
The Elo rating model has defined variables and evaluates NFL matchups consistently. It has more data behind it than choosing a winner based on who has a cooler mascot, a jersey that is your favorite color, or any other factors you or your friends may choose to consider when picking the team you plan to cheer for.
You can use Dataiku for any number of questions that you want answered and you can bet that there is a Dataiku integration that will make the Dataiku project far simpler and faster than you think. Have a league of your own and want to use the original design intent of Elo ratings? Dataiku could be your friend for next year’s “Pick’em league” or Fantasy sports draft and it will save you a lot of paper and manual work with a calculator.
The Super Bowl LVII Countdown Is On
Thanks to the power of Dataiku, we utilized open source data and external connections to create a Dataiku project with an Elo rating system in just a couple of hours. Who will Team Snow Fox Data be rooting for? We are staying true to the spirit of American football where it is said that "on any given Sunday, any team can beat any other team". So, like you, we anxiously await gameday to put our model to the test and see if the Philadelphia Eagles will take home the Super Bowl LVII title as predicted on February 12th.
| FEATURED AUTHOR: JON JORGENSON, SENIOR DATA CONSULTANT