{"cells":[{"metadata":{"_uuid":"c480e1ab7debd164e60d0b6333dbcd00ca23a9cd"},"cell_type":"markdown","source":"**Rule Change Suggestion**\n\n**1. Install “Targeting rule” like college football only in punt play.**\n\n* The “Targeting rule” we proposed, which is exactly same as that in college football, is applied only in punt play because kicking play has more potential risks of concussion than other normal plays.\n    \n**2. Install “One gunner on one cornerback rule”.**\n\n* The offensive team (kicking team) must allocate one player outside the top of nurmerals on the playing field, whilst the defensive team (receiving team) must not allocate more than two players outside the top of nurmerals on the playing field.\n    \n**3. Install a new rule “Receiving team can get 5 or 10 yards progress by fair-catch”.**\n\n* Receiving team can get 5 yards progress by fair-catch. Moreover, if the kicked punt distance (from scrimmage line) is longer than 50 yards, more 5 yards progress (total 10 yards) is awarded to receiving team."},{"metadata":{"_uuid":"8a64cd1afa14b0648cbd87c0290e13c830985485"},"cell_type":"markdown","source":"We're showing the analysis supporting our suggestion."},{"metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19","trusted":true},"cell_type":"code","source":"# This Python 3 environment comes with many helpful analytics libraries installed\n# It is defined by the kaggle/python docker image: https://github.com/kaggle/docker-python\n# For example, here's several helpful packages to load in \n\nimport numpy as np # linear algebra\nimport pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)\nimport matplotlib.pyplot as plt\nimport datetime\nimport collections\n# Input data files are available in the \"../input/\" directory.\n# For example, running this (by clicking run or pressing Shift+Enter) will list the files in the input directory\n\nimport os\nprint(os.listdir(\"../input\"))\n\n# Any results you write to the current directory are saved as output.","execution_count":null,"outputs":[]},{"metadata":{"_cell_guid":"79c7e3d0-c299-4dcb-8224-4455121ee9b0","collapsed":true,"_uuid":"d629ff2d2480ee46fbb7e2d37f6b5fab8052498a","trusted":false},"cell_type":"markdown","source":"**We started with EDA analysis and found what player activity and primary impact tends to cause concussions.**"},{"metadata":{"trusted":true,"_uuid":"ec9ccfa060fab3412a4dd8803cf6e34c610413ee"},"cell_type":"code","source":"#read video_review.csv\ninjury_df = pd.read_csv('../input/video_review.csv')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"24b5cb3aa23fdeeb92a7634e27a34ef69e66b142"},"cell_type":"code","source":"#count player activity and primary impact with the occurrence of concussions\ntackling_impact = pd.Series([0,0,0,0],index = ['Helmet-to-helmet', 'Helmet-to-body', 'Helmet-to-ground', 'Unclear'])\ntackled_impact = pd.Series([0,0,0,0],index = ['Helmet-to-helmet', 'Helmet-to-body', 'Helmet-to-ground', 'Unclear'])\nblocking_impact = pd.Series([0,0,0,0],index = ['Helmet-to-helmet', 'Helmet-to-body', 'Helmet-to-ground', 'Unclear'])\nblocked_impact = pd.Series([0,0,0,0],index = ['Helmet-to-helmet', 'Helmet-to-body', 'Helmet-to-ground', 'Unclear'])\n\nfor i in range(len(injury_df.index)):\n    act = injury_df.loc[i, 'Player_Activity_Derived']\n    imp = injury_df.loc[i, 'Primary_Impact_Type']\n    \n    if act == 'Tackling':\n        if imp == 'Helmet-to-body':\n            tackling_impact['Helmet-to-body'] += 1\n        elif imp == 'Helmet-to-helmet':\n            tackling_impact['Helmet-to-helmet'] += 1\n        elif imp == 'Helmet-to-ground':\n            tackling_impact['Helmet-to-ground'] += 1\n        else:\n            tackling_impact['Unclear'] += 1\n    elif act == 'Tackled':\n        if imp == 'Helmet-to-body':\n            tackled_impact['Helmet-to-body'] += 1\n        elif imp == 'Helmet-to-helmet':\n            tackled_impact['Helmet-to-helmet'] += 1\n        elif imp == 'Helmet-to-ground':\n            tackled_impact['Helmet-to-ground'] += 1\n        else:\n            tackled_impact['Unclear'] += 1\n    elif act == 'Blocking':\n        if imp == 'Helmet-to-body':\n            blocking_impact['Helmet-to-body'] +=1\n        elif imp == 'Helmet-to-helmet':\n            blocking_impact['Helmet-to-helmet'] +=1\n        elif imp == 'Helmet-to-ground':\n            blocking_impact['Helmet-to-ground'] +=1\n        else:\n            blocking_impact['Unclear'] +=1\n    elif act == 'Blocked':\n        if imp == 'Helmet-to-body':\n            blocked_impact['Helmet-to-body'] += 1\n        elif imp == 'Helmet-to-helmet':\n            blocked_impact['Helmet-to-helmet'] += 1\n        elif imp == 'Helmet-to-ground':\n            blocked_impact['Helmet-to-ground'] += 1\n        else:\n            blocked_impact['Unclear'] += 1\n\n#create dataframe\nact_impact = pd.DataFrame()\nact_impact['Tackling'] = tackling_impact\nact_impact['Tackled'] = tackled_impact\nact_impact['Blocking'] = blocking_impact\nact_impact['Blocked'] = blocked_impact","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"6d2ad41393e642267df85ca8a8fbb26318caadaf"},"cell_type":"code","source":"act_impact","execution_count":null,"outputs":[]},{"metadata":{"_kg_hide-output":false,"_kg_hide-input":false,"trusted":true,"_uuid":"5aeeb14ace4048dcb5e8f65f43cf659b14809599"},"cell_type":"code","source":"#visualize the dataframe above\nplt.rcParams['font.size'] = 14\nfig, ax = plt.subplots()\nim = ax.imshow(act_impact.values)\n\ncbar = ax.figure.colorbar(im, ax=ax)\ncbar.ax.set_ylabel('Times', rotation=-90, va=\"bottom\")\n\nax.set_xticks(np.arange(4))\nax.set_yticks(np.arange(4))\nax.set_xticklabels(act_impact.columns)\nax.set_yticklabels(act_impact.index)\n\nplt.setp(ax.get_xticklabels(), rotation=45, ha=\"right\",\n         rotation_mode=\"anchor\")\n\nfor i in range(4):\n    for j in range(4):\n        text = ax.text(j, i, act_impact.values[i, j], ha=\"center\", va=\"center\", color=\"w\", fontweight='bold')\n\nax.set_title(\"Activity & Impact\")\nfig.tight_layout()\nplt.show()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"ed3f69b3d4981a2aa4e9c98e0dfa2e4a6028d3ac"},"cell_type":"markdown","source":"Some features causing concussion event were found as follows.\n* Almost same number of concussions were occurred during both tackling (or tackled) and blocking (or blocked): 19 times in tacking and tackled, 18 times in blocking and blocked.\n* Tacking with helmet-to-body is the worst case (8 times), and blocking with helmet-to-helmet is the second (5 times).\n* With reviewing the punt play video when the concussions were occurred, \n    - The concussed players blocked by an opponent with high speed were often attacked on their head from their blind side.\n    - The concussed tackling players often attacked to an opponent with high speed.\n    - The concussed tacked players were tackled on their head by an opponent with high speed.\n\nWe concluded that **high speed tackling and blocking aiming to the head or legs of an opponent** are the main reason for the occurrence of concussions. \n\nWe could avoid the concussions with helmet-to-helmet collision by installing \"Targeting rule\" like college football did. However, it is not good idea to prohibit to tackle on the legs of a punt returner because this rule change would increase the tackle aiming to the head or upper part of the body and also could increase the occurrence of concussions.\n\nBased on the result of this analysis, we have two idea to decrease the occurrence of concussions.\n\n**1. Intall \"Targeting rule\", which is exactly same as that in college football, only in punt play.**\n\n**2. Decrease punt return play. That is, increasing fair-catch.**"},{"metadata":{"trusted":true,"_uuid":"b4a015ad141e56868c1b0b3634c1747fb21ff810"},"cell_type":"markdown","source":"For the first idea, we can only say \"Just do it\", but we have to consider how we increase fair-catch with rule cheange for the second idea.\n\n**From here, we analysed what features increase fair-catch in punt play.**"},{"metadata":{"trusted":true,"_uuid":"d57e1627fbc0e27d3223c4f34feade4588eb5ee0"},"cell_type":"code","source":"#Use NGS data and get them together\n\n#read NGS in 2016 and 2017\ndata2016_post = pd.read_csv('../input/NGS-2016-post.csv')\ndata2016_pre = pd.read_csv('../input/NGS-2016-pre.csv')\ndata2016_reg1 = pd.read_csv('../input/NGS-2016-reg-wk1-6.csv')\ndata2016_reg2 = pd.read_csv('../input/NGS-2016-reg-wk7-12.csv')\ndata2016_reg3 = pd.read_csv('../input/NGS-2016-reg-wk13-17.csv')\n\ndata2017_post = pd.read_csv('../input/NGS-2017-post.csv')\ndata2017_pre = pd.read_csv('../input/NGS-2017-pre.csv')\ndata2017_reg1 = pd.read_csv('../input/NGS-2017-reg-wk1-6.csv')\ndata2017_reg2 = pd.read_csv('../input/NGS-2017-reg-wk7-12.csv')\ndata2017_reg3 = pd.read_csv('../input/NGS-2017-reg-wk13-17.csv')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"617013f7132cbbb53a65a17631356de2ae588eaf"},"cell_type":"code","source":"#concat data for each year\ndata2016 = pd.concat([data2016_pre,data2016_reg1,data2016_reg2,data2016_reg3,data2016_post])\ndata2017 = pd.concat([data2017_pre,data2017_reg1,data2017_reg2,data2017_reg3,data2017_post])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"1735b94f854353b8284b71709f07e9f40d229c4a"},"cell_type":"code","source":"#read player role\nrole = pd.read_csv('../input/play_player_role_data.csv')\nrole = role.drop('Season_Year', axis = 1)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"8692f5e548c5b6beb1b005708da31600e8204757"},"cell_type":"code","source":"#add \"player role\" column\ndata2016 = pd.merge(data2016,role,on=['GameKey','PlayID','GSISID'])\ndata2017 = pd.merge(data2017,role,on=['GameKey','PlayID','GSISID'])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"60099f2dce5a7e8797df08fafee0baaa041c04dc"},"cell_type":"code","source":"#extract (GameKey, PlayID) list when punt receive or fair-catch was happened.\npuntPlay16_1 = data2016.query('Role==\"P\"').query('Event==\"punt\"')\npuntPlay16_2 = data2016.query('Role==\"PLS\"').query('Event==\"ball_snap\"')\npuntPlay16_3 = data2016.query('Role==\"PR\"').query('Event==\"punt_received\" or Event == \"fair_catch\"')\ngamePlay16_1 = [(i,j) for i,j in zip(puntPlay16_1.GameKey, puntPlay16_1.PlayID)]\ngamePlay16_2 = [(i,j) for i,j in zip(puntPlay16_2.GameKey, puntPlay16_2.PlayID)]\ngamePlay16_3 = [(i,j) for i,j in zip(puntPlay16_3.GameKey, puntPlay16_3.PlayID)]\ngamePlay16 = list(set(gamePlay16_1) & set(gamePlay16_2) & set(gamePlay16_3))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"5d8eb29c0d7e96c4bba6759a22702a8a7c462ec0"},"cell_type":"code","source":"puntPlay17_1 = data2017.query('Role==\"P\"').query('Event==\"punt\"')\npuntPlay17_2 = data2017.query('Role==\"PLS\"').query('Event==\"ball_snap\"')\npuntPlay17_3 = data2017.query('Role==\"PR\"').query('Event==\"punt_received\" or Event == \"fair_catch\"')\ngamePlay17_1 = [(i,j) for i,j in zip(puntPlay17_1.GameKey, puntPlay17_1.PlayID)]\ngamePlay17_2 = [(i,j) for i,j in zip(puntPlay17_2.GameKey, puntPlay17_2.PlayID)]\ngamePlay17_3 = [(i,j) for i,j in zip(puntPlay17_3.GameKey, puntPlay17_3.PlayID)]\ngamePlay17 = list(set(gamePlay17_1) & set(gamePlay17_2) & set(gamePlay17_3))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"8f09253963992f1fd013f4b566f21dc7cb73db4d"},"cell_type":"code","source":"#create defensive role list \ndefense_id = ['PDR1', 'PDR2', 'PDR3', 'PDL1', 'PDL2', 'PDL3', 'PLR', 'PLM', 'PLL', 'VRo', 'VRi', 'VLi', 'VLo', 'PR', 'PFB', 'VR', 'VL']","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"962decbd6a54110bf2b0c23dc28a716c00a14aa1"},"cell_type":"code","source":"#A function that includes some features (number of rushing players, number of conrnerbacks, hang time, punt distance, fair-catch)\ndef punt_feature(game_key, play_id, df):\n    \n    #extract a specific play in a specific game\n    df0 = df.query('GameKey == \"%s\"'%game_key).query('PlayID == \"%s\"'%play_id)\n    \n    #extract each event (ball_snap, punt, punt_received, fair_catch, others)\n    df_snap = df0.query('Event == \"ball_snap\"').reset_index().drop('index', axis = 1)\n    df_punt = df0.query('Event == \"punt\"').reset_index().drop('index', axis = 1)\n    df_received = df0.query('Event == \"punt_received\"').reset_index().drop('index', axis = 1)\n    df_faircatch = df0.query('Event == \"fair_catch\"').reset_index().drop('index', axis = 1)\n    df_tackle = df0.query('Event == \"tackle\"').reset_index().drop('index', axis = 1)\n    df_out = df0.query('Event == \"out_of_bounds\"').reset_index().drop('index', axis = 1)\n    df_touchdown = df0.query('Event == \"touchdown\"').reset_index().drop('index', axis = 1)\n    df_submit = df0.query('Event == \"play_submit\"').reset_index().drop('index', axis = 1)\n    \n    #extract x of scrimage line\n    scrimage_x = df_snap.query('Role == \"PLS\"')['x'].values[0]\n    \n    #extract x of punt reterner at receiving\n    if df_received.shape[0] > 0:\n        pr_x = df_received.query('Role == \"PR\"')['x'].values[0]    \n    else:\n        pr_x = df_faircatch.query('Role == \"PR\"')['x'].values[0]\n        \n    #extract x of punt returner at play end\n    if df_tackle.query('Role == \"PR\"').shape[0] > 0:\n        pr_xe = df_tackle.query('Role == \"PR\"')['x'].values[0]\n    elif df_out.query('Role == \"PR\"').shape[0] > 0:\n        pr_xe = df_out.query('Role == \"PR\"')['x'].values[0]\n    elif df_touchdown.query('Role == \"PR\"').shape[0] > 0:\n        pr_xe = df_touchdown.query('Role == \"PR\"')['x'].values[0]\n    elif df_submit.query('Role == \"PR\"').shape[0] > 0:\n        pr_xe = df_submit.query('Role == \"PR\"')['x'].values[0]\n    else:\n        pr_xe = pr_x\n        \n    #calculate hang time\n    punt_time = datetime.datetime.strptime(df_punt.loc[0,'Time'], '%Y-%m-%d %H:%M:%S.%f')\n    if df_received.shape[0] > 0:\n        receive_time = datetime.datetime.strptime(df_received.loc[0,'Time'], '%Y-%m-%d %H:%M:%S.%f')\n        fair_count = 0\n    else:\n        receive_time = datetime.datetime.strptime(df_faircatch.loc[0,'Time'], '%Y-%m-%d %H:%M:%S.%f')\n        fair_count = 1\n    hang_time = (receive_time - punt_time).total_seconds()\n    \n    #calculate punt distance\n    punt_dist = abs(pr_x - scrimage_x)\n    #calculate return distance\n    return_dist = abs(pr_x - pr_xe)\n    \n    #count cornerbacks\n    CB_count = 0\n    for r in df_snap.Role:\n        if r in ['VRo', 'VRi', 'VLi', 'VLo', 'VR', 'VL']:\n            CB_count += 1\n        else:\n            CB_count += 0\n    \n    return [game_key,play_id,punt_dist,return_dist,hang_time,CB_count,fair_count]","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"fecdf9c2415efbaec81731af39cfdf6bf82ab73c"},"cell_type":"code","source":"#create dataframe that includes some features\npunt_feat16 = pd.DataFrame(index = ['GameKey', 'PlayID', 'PuntDist', 'ReturnDist','HangTime', 'CB', 'fair_catch'])\nfor i in range(len(gamePlay16)):\n    g_id = gamePlay16[i][0]\n    p_id = gamePlay16[i][1]\n    punt_feat16[i] = punt_feature(g_id,p_id,data2016)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"a155861267d1808ee3a39e13b5410c5d629631ea"},"cell_type":"code","source":"punt_feat17 = pd.DataFrame(index = ['GameKey', 'PlayID', 'PuntDist', 'ReturnDist','HangTime', 'CB', 'fair_catch'])\nfor i in range(len(gamePlay17)):\n    g_id = gamePlay17[i][0]\n    p_id = gamePlay17[i][1]\n    punt_feat17[i] = punt_feature(g_id,p_id,data2017)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"3a019b88bea0d2de674160d415a469799d38ef9a"},"cell_type":"code","source":"punt_feat16 = punt_feat16.T\npunt_feat17 = punt_feat17.T\npunt_feat16['Year'] = 2016\npunt_feat17['Year'] = 2017\npunt_feat = pd.concat([punt_feat16, punt_feat17])\npunt_feat.index = range(punt_feat.shape[0])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"2bdaf9a4e490fa7f64d789da51345930e4331cc0"},"cell_type":"code","source":"punt_feat.head()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"f61823b2099ad60a7c33bb8d6755829f5ef67b7c"},"cell_type":"code","source":"#probability of fair-catch by the number of cornerbacks\nfairCatch_CB = pd.DataFrame(index = ['receive', 'fair_catch'])\nfor i in [2,3,4]:\n    fairCatch_CB[i] = [punt_feat.query('CB==\"%s\"'%i).query('fair_catch==0').shape[0], punt_feat.query('CB==\"%s\"'%i).query('fair_catch==1').shape[0]]\n    fairCatch_CB[i] = 100 * fairCatch_CB[i] / fairCatch_CB[i].sum()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"40d2b1918ad56dd303a4934db8f758b444ad03be"},"cell_type":"code","source":"fairCatch_CB","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"275836089cfd1bf20e1534f6fc966afbc08d783a"},"cell_type":"code","source":"#Number of cornerbacks VS probability of fair-catch\nfairCatch_CB.T.plot.bar(stacked = True)\nplt.xlabel('Number of Cornerbacks')\nplt.ylabel('Probability of fair-catch [%]')\nplt.legend(['Receiving', 'Fair-catch'],loc = (1.01, 0.8))","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"ac912c4feb2bf81f80ef4a8bb7aeb2e12e45304d"},"cell_type":"code","source":"fair_ratio = np.array([punt_feat.query('fair_catch==0').shape[0], punt_feat.query('fair_catch==1').shape[0]])\nfair_ratio = fair_ratio / fair_ratio.sum()\nprint(100*fair_ratio[1])#probability of fair-catch in all punt play","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"e61e2110bf52261bb8278806ba0461b244bc04fe"},"cell_type":"markdown","source":"**We found that fewer cornerbacks increases fair-catch: 34 % in all punt play, 50 % with two cornerbacks, 17 % with four cornerbacks.**\n\nThen, we analysed the correlation between number of cornerbacks and fair-catch in concussion plays."},{"metadata":{"trusted":true,"_uuid":"354e6ad76989d7573a5d5dcaccdbc963743b926f"},"cell_type":"code","source":"concussion_id = [(y,i,j) for y,i,j in zip(injury_df.Season_Year, injury_df.GameKey, injury_df.PlayID)]","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"1f455643809a1419ea922964adc7e71df6067596"},"cell_type":"code","source":"punt_injury = pd.DataFrame()\nfor y, g, p in concussion_id:\n    df = punt_feat.query('Year==\"%s\"'%y).query('GameKey==\"%s\"'%g).query('PlayID==\"%s\"'%p)\n    punt_injury = pd.concat([punt_injury, df])","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"71ee13aed88c871888f7c7342097a51dcaddea4a"},"cell_type":"code","source":"punt_injury.query('fair_catch==1')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"50e890fa901d85ac4eb0657c8a64ff5242a11b77"},"cell_type":"code","source":"injury_df.query('GameKey==\"%s\"'%280).query('PlayID==\"%s\"'%2918)\n# When a wing blocked a rusing player","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"dc57c66e7d40e7295feeac3aeae410c6bf12f10d"},"cell_type":"code","source":"injury_df.query('GameKey==\"%s\"'%506).query('PlayID==\"%s\"'%1988)\n# A returner showed fair-catch signal but he caught a one bounced ball and returned. Therefore this play should not be counted as fair-catch.","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"6fb5c49c91614c9af019e9b613e27f589fd0df37"},"cell_type":"code","source":"injury_df.query('GameKey==\"%s\"'%607).query('PlayID==\"%s\"'%978)\n# When a wing blocked a rusing player","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"486370f2c7ee4e37a6405a8882d145bea210506d"},"cell_type":"markdown","source":"**The results showed that few concussions was occurred in fair-catch play (only two play when a wing did blocking a rushing player).**\n\nFinally, we revealed how much probability of the occurrence of concussions changes by number of cornerbacks. "},{"metadata":{"trusted":true,"_uuid":"9aef86f8ef62a43313d570d3c7ad6d4ab410395e"},"cell_type":"code","source":"#calculate probability of the concussion by number of cornerbacks\ncb_count_all = collections.Counter(punt_feat.CB)\ncb_count_injury = collections.Counter(punt_injury.CB)\ninjuryRate_cb = pd.Series(index = [2, 3, 4])\nfor i in [2,3,4]:\n    injuryRate_cb[i] = 100 *cb_count_injury[i] / cb_count_all[i]","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"f1547e915dcf67ffed9bd94135127da81ee53b2a"},"cell_type":"code","source":"injuryRate_cb","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"50a2459dcc40495aabb5c4696b75244f072cb4e2"},"cell_type":"code","source":"injuryRate_cb.plot.bar(color = 'C2')\nplt.ylabel('Probability of concussion injury [%]')\nplt.xlabel('Number of cornerbacks')","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"ef71f8f5f8ffb8758fd859307c44e46f63436cc9"},"cell_type":"markdown","source":"**The result is that probability of concussion occurrence increases as the number of cornerbacks increases.**"},{"metadata":{"trusted":true,"_uuid":"ec3d4ebc4992cb65d05693f17d6846da6f1c3923"},"cell_type":"code","source":"100 * (injury_df.shape[0] - round(punt_feat.shape[0] * injuryRate_cb[2] / 100)) / injury_df.shape[0]","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"11e49b281d8c355761d379575602066cb1d0f8dd"},"cell_type":"markdown","source":"**In conclusion, by regulating the number of cornerbacks (maximum 2 CB), a half of punt play would result in fair-catch and the occurrence of concussions in punt play would decrease by 40%.**"},{"metadata":{"_uuid":"e2c1123e55130aa81a95370ec68045670f6b694f"},"cell_type":"markdown","source":"With regulating the number of cornerbacks, it becomes easier for the gunners to tackle a punt returner in high speed, and accordingly the tackled concussion risk would increase. In addition, a punt returner won't make fair-catch when the punt distance is long like over 50 yards. \n\nTherefore, **installing \"Targeting rule\" should play a significant role** to protect both the tackling gunners and the tackled punt returner."},{"metadata":{"_uuid":"36439519945bb8ca6fe0675e91d69cd68c9696ea"},"cell_type":"markdown","source":"Even though we regulate the number of the cornerbacks, we have some problems as follows.\n* This rule brings a disadvantage to the receiving team, because fair-catch will increase.\n* Fair-catch won't happen on the long distance punt. \n\nTo solve these problems, we suggested installing a new rule that the receiving team can get yards progress, which changes by the punt distance, by fair-catch. This new rule can give an advantage to the receiving team when making fair-catch, and accordingly increase fair-catch call. Moreover, with increasing progress yards by the punt distance, the receiving team would choose more fair-catch even on a long distance punt.\n\nWe analysed how the punt distance effects the probability of fair-catch **under two cornerback condition.**"},{"metadata":{"trusted":true,"_uuid":"a84b637d280c06759f4e27dd3e7aacd07520252e"},"cell_type":"code","source":"# average punt distance (about 47 yards)\npunt_feat.PuntDist.mean()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"f292667fc58195a8d65b638f84420ed47828e436"},"cell_type":"code","source":"# How punt distance effects fair-catch\nfair_puntDist = pd.Series(index = np.arange(20,65,5))\npuntDist_cb2 = pd.DataFrame(index = ['fair-catch','receive'])\nfor i in np.arange(20,65,5):\n    df = punt_feat[(punt_feat['PuntDist'] >= i) & (punt_feat['PuntDist'] < i + 5)]\n    fair0_count = df.query('CB==2').query('fair_catch==0').shape[0]\n    fair1_count = df.query('CB==2').query('fair_catch==1').shape[0]\n    \n    puntDist_cb2[i] = [fair1_count,fair0_count]\n    \n    if fair0_count == 0 and fair1_count == 0:\n        fair_puntDist[i] = 0\n    else:\n        fair_puntDist[i] = 100 * fair1_count / (fair0_count + fair1_count)\n        \nfair_puntDist.index = ['20-25','25-30','30-35','35-40','40-45','45-50','50-55','55-60','60-65']\npuntDist_cb2.columns = ['20-25','25-30','30-35','35-40','40-45','45-50','50-55','55-60','60-65']","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"cedb7dde57054f5aae5365d407dde987bd4aa11d"},"cell_type":"code","source":"puntDist_cb2.T.plot.bar(stacked = True)\nplt.xlabel('Punt distance [yards]')\nplt.ylabel('Number of punt play [-]')\nplt.ylim(0,500)","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"141ad6aefc9408c029ff204d36194c24372ebfe5"},"cell_type":"code","source":"fair_puntDist.plot.bar(color = 'C0')\nplt.ylim(0,100)\nplt.xlabel('Punt distance [yards]')\nplt.ylabel('Probability of fair-catch [%]')","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"2002dc000aa2edfaa8637fe9f0c059ee38e3cca6"},"cell_type":"code","source":"# Return yards when punt distance is less than 50 yards under the conditions, two cornerbacks and no fair-catch\npunt_feat.query('CB==2').query('fair_catch==0').query('PuntDist<50').ReturnDist.mean()","execution_count":null,"outputs":[]},{"metadata":{"trusted":true,"_uuid":"4504129df916eb436773ba3f3b49441377f69185"},"cell_type":"code","source":"# Return yards when punt distance is more than 50 yards under the conditions, two cornerbacks and no fair-catch\npunt_feat.query('CB==2').query('fair_catch==0').query('PuntDist>=50').ReturnDist.mean()","execution_count":null,"outputs":[]},{"metadata":{"_uuid":"c66687d85dd6b8702ad612f6f7511da654b4acf6"},"cell_type":"markdown","source":"We can see the probability of fair-catch decreases as the punt distance increases. On the punt play when the punt distance is over 50 yards punt, fair-catch was occurred by less than 30 %. Therefore we suggest changing the progress yards on whether the punt distance is over 50 yards or not, as follows.\n* The receiving team can get 5 yards progress by fair-catch on the condition that the punt distance is less than 50 yards.\n* The receiving team can get 10 yards progress by fair-catch on the condition that the punt distance is more than 50 yards.\n\nIn this suggestion, the punt distance means the distance between the scrimage line and the point where a punt returner catches a kicked ball."},{"metadata":{"_uuid":"28713ea6cfa57ce4e98b709f0cafb3029d39b811"},"cell_type":"markdown","source":"**Summary**\n\nSuggestion of rule changes\n\n1. Install \"Targeting rule\" like college football only in punt play.\n\n2. Install \"One gunner on one cornerbacks rule\"\n\n3. Install a new rule “Receiving team can get 5 or 10 yards progress by fair-catch”.\n\nEach rule change will reduce the occurrence of concussions to a certain extent. However, these rule change could interact with each other, therby have an big influence on reducing the occurrence of concussions in total."}],"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}