GithubHelp home page GithubHelp logo

wiscostret / nflfastr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nflverse/nflfastr

0.0 1.0 0.0 82.94 MB

A Set of Functions to Efficiently Scrape NFL Play by Play Data

Home Page: https://mrcaseb.github.io/nflfastR/

License: Other

R 100.00%

nflfastr's Introduction

nflfastR

GitHub release (latest by date) R build status Travis build status Twitter Follow

nflfastR is a set of functions to efficiently scrape NFL play-by-play data. nflfastR expands upon the features of nflscrapR:

  • The package contains NFL play-by-play data back to 1999
  • As suggested by the package name, it obtains games much faster
  • Includes completion probability (cp) and completion percentage over expected (cpoe) in play-by-play going back to 2006
  • Includes drive information, including drive starting position and drive result
  • Includes series information, including series number and series success
  • Hosts a repository of play-by-play data going back to 1999 for very quick access
  • Features new and enhanced models for Expected Points, Win Probability, and Completion Probability (see section below)

We owe a debt of gratitude to the original nflscrapR team, Maksim Horowitz, Ronald Yurko, and Samuel Ventura, without whose contributions and inspiration this package would not exist.

Installation

You can load and install nflfastR from GitHub with:

# If 'devtools' isn't installed run
# install.packages("devtools")

devtools::install_github("mrcaseb/nflfastR")

Usage

We have provided some application examples under vignette("examples"). However, these require a basic knowledge of R. For this reason we have the nflfastR beginner’s guide in vignette("beginners_guide"), which we recommend to all those who are looking for an introduction to nflfastR with R.

Data repository

Even though nflfastR is very fast, for historical games we recommend downloading the data from here. These data sets include play-by-play data of complete seasons going back to 1999 and we will update them in 2020 once the season starts. The files contain both regular season and postseason data, and one can use game_type or week to figure out which games occurred in the postseason. Data are available as .csv.gz, .parquet, or .rds.

nflfastR models

nflfastR uses its own models for Expected Points, Win Probability, Completion Probability, and Expected Yards After the Catch. To read about the models, please see vignette("nflfastR-models"). For a more detailed description of Expected Points models, we highly recommend this paper from the nflscrapR team located here.

Here is a visualization of the Expected Points model by down and yardline.

Here is a visualization of the Completion Probability model by air yards and pass direction.

nflfastR includes two win probability models: one with and one without incorporating the pre-game spread.

Special thanks

nflfastr's People

Contributors

mrcaseb avatar guga31bb avatar wiscostret avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.