dimanche 6 mars 2016

NBA Player Stats Explorer

The NBA Player Stats Explorer aims to allow users to visually explore statistics related to the play during the 2015/2016 season of the National Basketball Association (or NBA).

NBA statistics are available in a number of places, but custom plotting of one statistic against another is nowhere to be found (to my admittedly limited knowledge). It will allow all NBA fans to get new insight on the abilities of their favorite players, and compare players against one another on various “profiles”. For a basic example, you could ask “Who are the best inside-out players in the league?”, and get a reasonable answer by plotting Rebounds against 3 point shots made.

The application is available at this address :

NBA Player Stats Explorer


Using the Explorer

You can choose which statistic to use on X and Y axes, and apply several filters on the data you want to show. On the right panel, the corresponding plot will show instantly. Mouse-over information is available to know which point represent which player. Means for both chosen X and Y variables are calculated on the fly on the current sample of players and shown right below the plot.

Filtering is done via the use of three sliders and one drop-down menu. The sliders let you define a range for the following filters :
  • Games played
  • Minutes per game (average)
  • Age
The drop-down menu offers the possibility to only show players of a specific team. The “TOT” value represents all players who have been traded since the start of the season, and offers statistics on whe whole season, combining games played with their former and their new teams.

The checkbox allows to only plot the 2016 Free Agents.


Free Agents

Free agents are players whose contract expire at the end of the current season. This information was added to the Explorer, as it allows users to have a quick idea of the soon-to-be available talent pool for their favorite team, and to compare these free agents against one another to find the best possible fit for their team needs.


The Data

All the statistics have been exported from Basketball Reference. Coverage starts on the first night of the season, and should cover about the whole season played so far (games played the previous night might need a few hours to be included though).

The list of Free Agents for the summer of 2016 has been exported from RealGM.

A consolidated CSV file has been created using both sources, and various modifications have been performed to allow for easier use.


Advanced Statistics Definitions

Here are the definitions of the more obscure, “advanced”" stats, from Basketball Reference :
  • Player Efficiency Rating : a measure of per-minute production standardized such that the league average is 15
  • True Shooting Percentage : a measure of shooting efficiency that takes into account 2 point field goals, 3 point field goals, and free throws
  • 3 Point Attempt Rate : percentage of FG Attempts from 3-Point Range
  • Free Throw Attempt Rate : number of FT Attempts Per FG Attempt
  • Offensive Rebound Percentage : an estimate of the percentage of available offensive rebounds a player grabbed while he was on the floor
  • Defensive Rebound Percentage : an estimate of the percentage of available defensive rebounds a player grabbed while he was on the floor
  • Total Rebound Percentage : an estimate of the percentage of available rebounds a player grabbed while he was on the floor
  • Assist Percentage : an estimate of the percentage of teammate field goals a player assisted while he was on the floor
  • Steal Percentage : an estimate of the percentage of opponent possessions that end with a steal by the player while he was on the floor
  • Block Percentage : an estimate of the percentage of opponent two-point field goal attempts blocked by the player while he was on the floor
  • Turnover Percentage : an estimate of turnovers committed per 100 plays
  • Usage Percentage : an estimate of the percentage of team plays used by a player while he was on the floor
  • Offensive Win Shares : an estimate of the number of wins contributed by a player due to his offense
  • Defensive Win Shares : an estimate of the number of wins contributed by a player due to his defense
  • Win Shares : an estimate of the number of wins contributed by a player
  • Win Shares Per 48 Minutes : an estimate of the number of wins contributed by a player per 48 minutes (league average is approximately .100)
  • Offensive Box Plus/Minus : a box score estimate of the offensive points per 100 possessions a player contributed above a league-average player, translated to an average team
  • Defensive Box Plus/Minus : a box score estimate of the defensive points per 100 possessions a player contributed above a league-average player, translated to an average team
  • Box Plus/Minus : a box score estimate of the points per 100 possessions a player contributed above a league-average player, translated to an average team
  • Value over Replacement Player : a box score estimate of the points per 100 TEAM possessions that a player contributed above a replacement-level (-2.0) player, translated to an average team and prorated to an 82-game season. Multiply by 2.70 to convert to wins over replacement


Possible Improvements

  • Add filtering by dates.
  • Allow filtering by all statistics
  • Allow choice of color-coded legend (currently only with free agency status).
  • Allow for statistics from previous seasons to be loaded.
  • Add positions to the data set for more filtering possibilities.


Visual Design

The visual design of this product has been inspired by the Movie Explorer project exposed in the Shiny Gallery. The interactive plots are implemented using the ggvis R package.


Source Code

The source code for the whole project is freely available on GitHub :

NBA Stats Explorer


Contact

Aucun commentaire:

Enregistrer un commentaire