6 ms·
Interactive NBA Shot Charts with R and Shiny
- fluxquanta 11y agoWith the way Curry has been playing some of these charts are going to need to be re-scaled to include beyond the half court line. 35/57 from 28 feet and farther currently (61.4%).
- defen 11y agoTo put into perspective how absurd that is...to a first approximation (ignoring rebounds, open opportunities, etc) - Curry's expected value for shooting from 6 or more feet behind the three point line (1.923) is higher than almost any other shot any other player in NBA history could attempt, except perhaps an uncontested dunk. You'd rather Curry attempt one of his super-deep threes than have the best free-throw shooter of all time (Steve Nash) take two free throws (90.43% accuracy, expected value 1.8086 points). That is just insane.
- e40 11y agoWhen you put it like that it gives me goosebumps. It is truly a great time to be an NBA fan.
- baldfat 11y agoIt is a great time BUT I miss the drama of the 1980s and early 1990s. At least I don't get the normal "I watch college basketball" when I start talking basketball. I am an avid UConn fan and they don't know college either except the Final 4 tourney polls they are apart of.
- kohanz 11y agoNice work. I expect the OP will be hearing from NBA teams at some point. There was a guy who made something very similar a couple of years ago (not in R, but same functionality) and he now works for an NBA team (a friend of mine works on the same analytics team). Of course, he had to bring his side-project with him and take it offline.
- genghisjahn 11y agoFork!
- ssharp 11y agoKirk Goldsberry? He did these for Grantland and now works with the Spurs.
- kohanz 11y agoNo, Goldsberry was very high profile (did a lot of work for ESPN/Grantland). I'm talking about more of a hacker type who did a Show HN type side-project and got noticed entirely through that. edit: I found the project - looks like it back online: http://peterbeshai.com/buckets/app/#/playerView/201935_2015 http://peterbeshai.com/buckets/app/#/playerView/201935_2015
- deleted 11y ago[deleted]
- minimaxir 11y agoI've had looked into Shiny apps for my own ggplot2 work, but after seeing the usage in this post, I'll definitely give it another look! What initially kept me away was the amount of idiosyncratic code required for the server/UI without many tutorials, which made compatibility annoying. Looking at the code in the GitHub, the code still seems pretty difficult. That, and http://www.shinyapps.io/ http://www.shinyapps.io/ (which the OP is using) is very ambigious in their pricing on how "Active Hours" work, which is a valid concern when a post hits the front page of Hacker News.
- RA_Fisher 11y agoIt's possible to host a Shiny app yourself. This one runs on AWS EC2 inside a docker container: http://www.statwonk.com/birthday-problem/ http://www.statwonk.com/birthday-problem/
- minimaxir 11y agoThat appears to be the best option for my use cases. Although I'm not sure if that makes pricing worse or better. :P
- redtuesday 11y agoI don't know, but maybe you can run shiny on red hats free plan of openshift online: https://github.com/ekergy/shiny-ekergy https://github.com/ekergy/shiny-ekergy
- aroch 11y agoI host two different RNAseq and NGS data exploration shiny apps on a 2GB DO droplet and it works pretty well. Shiny-server is sort of a pain in the ass though, and I agree the documentation sucks
- IndianAstronaut 11y agoShiny is super easy to use. Probably the easiest tool to get high quality dashboards up and running. The only mildly difficult concept is the reactivity concept.
- baldfat 11y agoThis is why I love R. This works great and the code is super clean. NBA Notes: I love the fact that the players are sorted by first name and that made no difference. This is the easiest to follow professional sport in the world. Carmelo Anthony: He started shooting from the right 3pt corner really well. Now 10 years later he is hot from the left corner and not that right polar opposite. Seems like the sides he shot from changed in a pattern. I bet you the scouts were like Anthony can't shoot from the right make him shoot from there and he would practice that side.
- crispyambulance 11y agoWait a sec, how does the NBA get the shot data? It looks like there's positional information in there. Are they collecting this using machine vision?
- TheBiv 11y agoYes they are, the NBA has cameras mounted in the rafters for this specific purpose source: https://www.washingtonpost.com/sports/wizards/nba-analytics-movement-includes-placing-six-cameras-in-rafters-at-all-30-team-arenas/2013/10/25/ac9fc826-3d7a-11e3-b0e7-716179a2c2c7_story.html https://www.washingtonpost.com/sports/wizards/nba-analytics-... company behind the tech: http://www.stats.com/sportvu/sportvu-basketball-media/ http://www.stats.com/sportvu/sportvu-basketball-media/
- prawn 11y agoOther leagues would likely do it manually with stats callers and spotters - literally one person calls out the stat as they see it, and the other enters it into the software. NBA and technology have progressed to be able to justify doing it with cameras. They have some great software/analysis whereby they can watch all players, note where they are and where they should be (based on opponent's shooting or penetrating ability) and then work out which players spend the most time where they should be.
- pitt1980 11y agobm
- fuzzythinker 11y agoSimilar but not as featured and fancy with vega: http://sandbox.github.io/demos/nba-shot-chart-vega/ http://sandbox.github.io/demos/nba-shot-chart-vega/ which includes link for one done in python, and Kirk Goldsberry’s articles on Grantland.
- ssharp 11y agoSteph Curry's 2015-16 shot chart is the epitome of sports data analysts insistence over the past few years that three pointers are far more efficient shots than most two point shots. Almost all of Steph's shots this year are either at the basket or behind the three point line. I guess it just took a generational player, who could shoot not only extremely accurate from distance, but can also fire of a shot quickly as well as create his own space for shots, to fully exploit the extremes of that data.