{"cells":[{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","collapsed":true,"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":false,"_kg_hide-input":false},"cell_type":"markdown","source":"Hello! I'm new to this so be patient.  I don't even know how to creat a kernal :(  I'm an MBA who doesn't know how to code (at all). I took this side project as a way to improve my analytics skills over break.  I've found a couple things that I think are useful, but have done my work in Excel and RapidMiner.  I'm trying to learn R and Python but it looks like it will be a long journey.\n\n**Getting Started**\nI spent about a day getting familiar with each of the csv files, the attributes, and the relationships within the data.  I started creating a number of new attributes in files such as Fair Catch, Downed, Out of Bounds, or Touchback.  I also looked into whether or not the punt was from the punting team's side of the field.  \n\nThis gave me some basic info:\n<img src=https://imgur.com/5P5TLIN.png>\n\nOwn Side of Field\t\n<img src=https://imgur.com/4YB64xW.png>\n\nI also found that night games had nearly double the concussion rate\n<img src=https://imgur.com/dK5SR50.png>\n\n**Re-focusing on the problem**\nUltimately I realized while a lot of this is helpful, I'm not sure much of it is useful in adapting the game.  In addition, if I want to predict concussions on punt plays, a lot of this data like fair catch is data leakage.  \n\nUltimately, I decided to explore play formation and the impact on concussions.  To do so, I needed to get my hands around the players and roles on the field for various plays.\n\n**Manipulating the Play_Player_Role_Data file**\nSo many player roles!  I wanted to simplify the player roles.  Ultimately I made several replacements.  For each of the positions, I got rid of the numbers associated with the role.  For instance, PDL3 became PDL.  I then looked into concussion rates by player.  \n\nThe punting team incurs most concussions and concussion rates vary by role, but interior linemen have a lot.  \n<img src=https://imgur.com/DGtKtKG.png>\n\nFor the return team, most concussions were on the punt returner.  \n<img src=https://imgur.com/bmffj7o.png>\n\n\n**Evaluating Plays by Formation**\nSince I don't know how to code, I started creating columns in the play_information file.  I used countif statements to identify how many players at each position were involved in each play.  Now the fun comes in!  \n\nMy hypothesis was that players running at fast speeds down the field are going to get concussions.  And how do these interior linemen that have so many concussions get at high speeds? They must not be blocked, right?\n\nSo I created a couple of different attributes to add to my play data.  One attribute was Number of Defenders in the Box.  This is defined as a count of PDL, PDR, PLL, PLR, and PLM players.  The other attribute is the Side Overload.  This is defined as the absolute value between players on the left side in the box and players on the right side in the box.  | PDL + PLL - PDR - PDR | \n\nA simple pivot table showed some promising signs.  There was positive correlation between Side Overload and Concussions.  There was negative correlation between Number of Defenders in the Box and Concussions.\n\nOverloaded Def\tConcussion\tPlays\t%\n<img src=https://imgur.com/mt9VNot.png>\n\nDEF in the Box\tConcussions\tPlays\t%\n<img src=https://imgur.com/7aNSMhE.png>\n\nIllustration of the box\n<img src=https://imgur.com/7eXkY9N.png>\n\nRelationships between concussions and formation\n<img src=https://imgur.com/tUGG9OZ.png>\t\n\n<img src=https://imgur.com/iL4Nw4q.png>\n\n**Modeling Play Formation**\nI used RapidMiner to then create a logistic regression using play formation.  I filtered out outliers like <6 players in the box or >9.  I created the model using 70% training data and tested it on the other 30%.\n\n****Of note, I filtered out several plays that I considered outliers.  This included Overload >=4, DEF BOX <6, DEF BOX>8.  It is normal for the defense to to have 6-8 in the box, with either doubling up on the gunners or putting single coverage on the gunners.  I also used a filter for \"no punt\" because of penalty or other instance (fake punt / blocked punt) and not using out of bounds kicks or touchbacks.  I calculated \"no punt\" based on punt yardage.  I had calculated punt yardage as a field for every play based on the PlayDescription field where it will say \"punts XX yards\" when there is a punt.  This represented 220 observations.  The other filters excluded 150 observations.\n\n<img src=https://imgur.com/1HH9AEt.png>\n\nThe successfully predicted 3/11 concussion plays.  Given how rare of an event a concussion is on any given play, I thought this was pretty good.  \n<img src=https://imgur.com/hITvquM.png>\n\nTherefore my recommendation will be focused on making the formation include 8 players in the box and not overloading one side of the box.\n"}],"metadata":{"kernelspec":{"display_name":"Python 3","language":"python","name":"python3"},"language_info":{"name":"python","version":"3.6.6","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"}},"nbformat":4,"nbformat_minor":1}