Live data from Hacker News

Every NFL play for the past 10 years in CSV format

advancednflstats.com

81–90 of 105 posts

Re: Every NFL play for the past 10 years in CSV format

#81
The CSV file format is nice, but if you're looking for a Python API to play with NFL stats without having to parse play-data fields, check out nflgame [1]. I've written up a quick primer. [2] It also includes the ability to get play-by-play statistics live.

[1] - https://github.com/BurntSushi/nflgame

[2] - http://blog.burntsushi.net/nfl-live-statistics-with-python

Re: Every NFL play for the past 10 years in CSV format

#82
post #54
post #37

Earlier quoted context omitted.

It looks like a lot of the work you are hoping to do has already been done on http://statsheet.com/nfl Though perhaps not as open...

See also, http://www.pro-football-reference.com/ , but I'd love to see something on github.

It exists. Check out nflgame. [1]

[1] - https://github.com/BurntSushi/nflgame

Re: Every NFL play for the past 10 years in CSV format

#83
Here's some soccer data, doesn't include play-by-play though (soccer generally isn't suited to that kind of breakdown, although Opta Sports do track it).

http://www.football-data.co.uk/downloadm.php

Tons of European leagues, going back to 1993 in some cases.

Here's some sites that give detailed stats and match reports:

http://www.eplindex.com/

http://www.whoscored.com/

http://www.soccerstats.com/

http://www.soccerway.com/

http://www.squawka.com/

Man City use their petro-dollars to open up Opta Sports (detailed match stats) to all: http://www.mcfc.co.uk/the-club/mcfc-analytics

Someone needs to compile stats equivalent to these NFL ones for european football! Hmmmm...

Re: Every NFL play for the past 10 years in CSV format

#84

Earlier quoted context omitted.

It doesn't work like that in practice. Football is very dependent on matchups. Coaches will vary gameplans from week-to-week to exploit weaknesses they see on film.

Matchup would be a part of the model. My experience with predictive modeling in various domains has taught me that people tend to underestimate how predictive they are (NFL offensive/defensive coaches are no exception).

I'm interested in doing some predictive modeling for a couple of project ideas I've been kicking around. Are there any specific resources you would recommend as good starter material?

Re: Every NFL play for the past 10 years in CSV format

#85

Earlier quoted context omitted.

You'll find that the text descriptions aren't consistently formatted. It's tough to extract structured data from all play descriptions. For example, first initial plus last name does does not uniquely identify a player. You'll need accurate roster data first, and even then there are clashes. We store play data by its structured components (players involved, play type, player roles, etc) and then derive the text descr…

"It's tough to extract structured data from all play descriptions." Which means you can treat it a bit like a text mining program. NASA had a text mining contest in 2007 as part of the SIAM conference on data mining which was really similar - instead of football plays it was textual descriptions of aeronautics incident reports and their classification. There were several papers that came out of that (I was with a gro…

Incredibly interested in your work here. For small-dimensional problems (or problems with features that can be engineered to be small-dimensional), ensemble methods through random forests and bagging and the like are incredibly useful.

But for high-dimensional text problems that're pure classification, I tend to rely simply on 1NN classifiers (against a single centroid of training data of a target category, of which there tend to be many). I've spent a lot of time with NMF, for its potential as an incredibly interesting data-exploration tool ("There's a pronoun cluster! There's a Spanish cluster! There's a 404 Error axis!") or low-dimension projection step. I've even spent a good amount of time on implementing the algorithm in a number of memory-efficient ways.

Could you expand a bit on how you used NMF for these problems in practice (similar to how a sparse autoencoder captures reduced-dimensional features en route to supervised learning), or how others used ensemble methods?

Re: Every NFL play for the past 10 years in CSV format

#87
post #30

Earlier quoted context omitted.

If only a single play call had a single potential outcome, and that outcome was always met. Using these stats for predictions would seem extremely difficult beyond answering, "will it be a run or a pass?"

If you were the defensive coordinator on the opposing team, knowing the answer to "run or pass" with a high degree of certainty would give you a pretty large advantage.

http://www.advancednflstats.com/2010/06/bill-walsh-on-random...

In his early Stanford days, Bill Walsh had already cracked the code on how un-random football coaches (and almost all people) are. From "Controlling the Ball with the Passing Game":

"We know that if they don't blitz one down, they're going to blitz the next down. Automatically. When you get down in there, every other play. They'll seldom blitz twice in a row, but they'll blitz every other down. If we go a series where there haven't been blitzes on the first two downs, here comes the safety blitz on third down."

Most NFL offenses tend to alternate rather than randomize. Walsh knew defenses were just as predictable decades ago.

Re: Every NFL play for the past 10 years in CSV format

#88
If you live in the vicinity of Seattle, there is a sports-themed hackathon going on Superbowl weekend. Google, ESPN and a bunch of tech companies are sponsoring. The grand prize will be passes to the Sloan Sports Conference. More details to come:

http://sportshackday.com

Re: Every NFL play for the past 10 years in CSV format

#89
There is a lot to have fun with here. I would imagine though that in a lot of NFL coaching rooms there has to be a balance between coaching and analysis.

Like someone else said, it's about match-ups.

Semi-related : http://profootballtalk.nbcsports.com/2013/01/03/polian-think...

Re: Every NFL play for the past 10 years in CSV format

#90

Earlier quoted context omitted.

"It's tough to extract structured data from all play descriptions." Which means you can treat it a bit like a text mining program. NASA had a text mining contest in 2007 as part of the SIAM conference on data mining which was really similar - instead of football plays it was textual descriptions of aeronautics incident reports and their classification. There were several papers that came out of that (I was with a gro…

Incredibly interested in your work here. For small-dimensional problems (or problems with features that can be engineered to be small-dimensional), ensemble methods through random forests and bagging and the like are incredibly useful. But for high-dimensional text problems that're pure classification, I tend to rely simply on 1NN classifiers (against a single centroid of training data of a target category, of which…

Afraid it's been a while, and I wasn't really at the core of the project design - if you're REALLY interested look up _Anomaly Detection Using Nonnegative Matrix Factorization_ and contact Michael W Berry (whom I assume still teaches at the University of Tennessee, Knoxville).

The main idea, though, is to generate a term-by-document matrix (count words, maybe throw out stopwords, normalize counts), then do Math to factor your matrix (approximately) into two: term-by-feature and feature-by-document. When you want to classify a new document, you can use its contents (more terms) to calculate a feature vector.

(The math seems to typically involve random initialization followed by iterative improvements. Other work in the field discusses the specifics.)

The matricies are "nonnegative" because, conceptually, features are a _positive_ thing, and you can't say that a certain term makes something less a member of a feature cluster (only more).

The tricky part is figuring out how to map features to things which are semantically interesting to your application, and I don't want to comment too much on the state of that because it's been five years and I honestly forgot what exactly we did there, and it was all done in Matlab (which I'd never used before), and there's probably more recent work in the field. But if you fiddle with it manually, you can come up with your matrices and essentially have a nice little classifier.

Post reply on HN