BurntSushi / nfldb

A library to manage and update NFL data in a relational database.
The Unlicense
1.08k stars 264 forks source link

Expected Points & Win Probability #316

Open seanpdwyer7 opened 4 years ago

seanpdwyer7 commented 4 years ago

Hi, I'm wondering if any of you have found a way of implementing an Expected Points & Win Probability models into their Postgres Server?

Wondering if any of you have had any luck implementing scripts.

Thanks!

hardyaf commented 4 years ago

Sean,

I have a python script that does win probability. I can share with you, but in reality the fivethirtyeight github (https://fivethirtyeight.com/methodology/how-our-nfl-predictions-work/) explains it better than I can. For EPA, there is a lot of question about what model you want to use. If you want to develop your own, let me know, the math is fairly simple, but its much easier to take a known regression and apply it (EPA is a well studied topic, imo there aren't a ton of gains to be made from developing your own model).

IMO the real answer to these questions is to not implement in your postgres server directly because there are a lot of calculations. It's much better to pull from SQL to python, and push back into SQL tables once the math is done (if you need to, I don't think you really ever need to put it back into SQL, since the NFL data size is actually quite small relatively).