{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"pygments_lexer":"ipython3","nbconvert_exporter":"python","version":"3.6.4","file_extension":".py","codemirror_mode":{"name":"ipython","version":3},"name":"python","mimetype":"text/x-python"}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"## 赛事介绍\n在NFL的教练们庆祝一场大胜前，他们会针对场地进攻线推进以及得分针对策略，这两个目标都会从一些特殊的比赛战术中受益匪浅，这些战术包括踢球、开球、射门得分以及额外加分，这些战术在比赛的最终得分上是如此的重要，以至于教练们认为它们能占据比赛的1/3，即便如此，这些特殊战术依然是橄榄球比赛中未被充分研究的部分，现在，是时候基于数据科学来更好的理解它们了。\n\n现在，2022届NFL大数据碗提供了一个很好的机会去比以往都更加多的学习这些特殊战术，赛事提供了从18到22年的NFL的特殊战术的[下一代统计追踪数据](https://nextgenstats.nfl.com/)，这份数据提供了每次特殊战术中所有球员的位置信息，包括球场的任意位置、速度、加速度、方向。此外，在NLF大数据碗历史上第一次，参赛者可以使用[PFF](https://www.pff.com/)的侦察数据，它使用一些教练们认为对胜利至关重要的指标来补充我们的追踪数据。\n\nNFL是全美最受欢迎的体育赛事联盟，它成立于1920年，成为了成功的体育赛事联盟的标杆，它们致力于推进比赛的方方面面，包括研究很少的特殊战术。在此次竞赛中，你将量化特殊战术，你可能需要创建新的指标来衡量球队或者个人的策略，对球员进行排名，或者其他我们没有考虑到的方面。\n\n凭借你的创造力和分析力，这些新的方法和指标可能会成为特殊战术的新的统计指标。如果你成功了，你的方法可能会被NLF采纳并用于未来橄榄球比赛中，并能看到你对于这个最受欢迎的赛事联盟的贡献。\n\n## 比赛规则介绍\n在长100码（加上端区则是120码），宽53的场地上，比赛双方各自需要有11名球员，攻守以交替的方式进行，假设目前由A进攻，B防守，则意味着A队的进攻组上场，B队的防守组上场，此时A有4次机会向前推进10码，如果达成，则A再次获得4次进攻的机会，否则进攻权给到B，双方原地交换攻守。其次，得分方式有两种，第一种是由球员带球进入对方的端区（达阵），则得6分，达阵后，进攻方可以选择15码射门再得1分，或者2码再次达阵再得2分，其次是通过脚踢的方式（任意球）将球踢入对方球门，则得3分。\n\n## 评估方式\n由于该赛事并不是传统的预测类比赛，因此评估方式基于提交的Notebook，以下是几个Notebook可以探索的方向建议：\n1. 创造一个新的特殊战术指标；\n2. 量化特殊战术策略；\n3. 针对特殊战术的执行球员进行排名。\n\n## 数据及字段描述\n- games.csv\n    - gameId: 唯一比赛标识\n    - season: 比赛所属赛季\n    - week: 比赛所处周\n    - gameDate: 比赛日期\n    - gameTimeEastern: 比赛开始时间\n    - homeTeamAbbr: 主队编码\n    - visitorTeamAbbr: 客队编码\n- plays.csv\n    - gameId: 唯一比赛标识\n    - playId: 唯一回合表示，同一场比赛中唯一\n    - playDescription: 回合描述\n    - quarter: 第几节比赛\n    - down: 触地\n    - yardsToGo: 达到下一轮进攻需要的码数\n    - possessionTeam: Team punting, placekicking or kicking off the ball (text)\n    - specialTeamsPlayType: 特殊战术类型\n    - specialTeamsPlayResult: 特殊战术结果，Special Teams outcome of play dependent on play type: Blocked Kick Attempt, Blocked Punt, Downed, Fair Catch, Kick Attempt Good, Kick Attempt No Good, Kickoff Team Recovery, Muffed, Non-Special Teams Result, Out of Bounds, Return or Touchback (text)\n    - kickerId: nflId of placekicker, punter or kickoff specialist on play (numeric)\n    - returnerId: nflId(s) of returner(s) on play if there was a special teams return. Multiple returners on a play are separated by a ; (text)\n    - kickBlockerId: nflId of blocker of kick on play if there was a blocked field goal or blocked punt (numeric)\n    - yardlineSide: 3-letter team code corresponding to line-of-scrimmage (text)\n    - yardlineNumber: Yard line at line-of-scrimmage (numeric)\n    - gameClock: Time on clock of play (MM:SS)\n    - penaltyCodes: NFL categorization of the penalties that occurred on the play. A standard penalty code followed by a d means the penalty was on the defense. Multiple penalties on a play are separated by a ; (text)\n    - penaltyJerseyNumber: Jersey number and team code of the player committing each penalty. Multiple penalties on a play are separated by a ; (text)\n    - penaltyYards: yards gained by possessionTeam by penalty (numeric)\n    - preSnapHomeScore: Home score prior to the play (numeric)\n    - preSnapVisitorScore: Visiting team score prior to the play (numeric)\n    - passResult: Scrimmage outcome of the play if specialTeamsPlayResult is \"Non-Special Teams Result\" (C: Complete pass, I: Incomplete pass, S: Quarterback sack, IN: Intercepted pass, R: Scramble, ' ': Designed Rush, text)\n    - kickLength: Kick length in air of kickoff, field goal or punt (numeric)\n    - kickReturnYardage: Yards gained by return team if there was a return on a kickoff or punt (numeric)\n    - playResult: Net yards gained by the kicking team, including penalty yardage (numeric)\n    - absoluteYardlineNumber: Location of ball downfield in tracking data coordinates (numeric)\n- players.csv\n    - gameId: 唯一比赛标识\n    - playId: 唯一回合表示，同一场比赛中唯一\n    - nflId: 球员唯一标识\n    - Height: 球员身高\n    - Weight: 球员体重\n    - birthDate: 球员生日\n    - collegeName: 毕业大学\n    - Position: 场上位置\n    - displayName: 球员姓名\n- tracking20xx.csv\n    - time: 回合时间\n    - x: Player position along the long axis of the field, 0 - 120 yards. See Figure 1 below. (numeric)\n    - y: Player position along the short axis of the field, 0 - 53.3 yards. See Figure 1 below. (numeric)\n    - s: Speed in yards/second (numeric)\n    - a: Speed in yards/second^2 (numeric)\n    - dis: Distance traveled from prior time point, in yards (numeric)\n    - o: Player orientation (deg), 0 - 360 degrees (numeric)\n    - dir: Angle of player motion (deg), 0 - 360 degrees (numeric)\n    - event: Tagged play details, including moment of ball snap, pass release, pass catch, tackle, etc (text)\n    - nflId: Player identification number, unique across players (numeric)\n    - displayName: Player name (text)\n    - jerseyNumber: Jersey number of player (numeric)\n    - position: Player position group (text)\n    - team: Team (away or home) of corresponding player (text)\n    - frameId: Frame identifier for each play, starting at 1 (numeric)\n    - gameId: Game identifier, unique (numeric)\n    - playId: Play identifier, not unique across games (numeric)\n    - playDirection: Direction that the offense is moving (left or right)\n- PFFScoutingData.csv\n\n## 赛事数据EDA","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19"}},{"cell_type":"code","source":"import numpy as np\nimport pandas as pd\n\nimport os\nfor dirname, _, filenames in os.walk('/kaggle/input'):\n    for filename in filenames:\n        print(os.path.join(dirname, filename))","metadata":{"execution":{"iopub.status.busy":"2021-10-19T02:51:44.9036Z","iopub.execute_input":"2021-10-19T02:51:44.903991Z","iopub.status.idle":"2021-10-19T02:51:44.930967Z","shell.execute_reply.started":"2021-10-19T02:51:44.903894Z","shell.execute_reply":"2021-10-19T02:51:44.930142Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"","metadata":{},"execution_count":null,"outputs":[]},{"cell_type":"markdown","source":"","metadata":{}}]}