-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathREADME.Rmd
103 lines (70 loc) · 6.11 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r rdmesetup, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# cfb4th <a href='https://cfb4th.sportsdataverse.org'><img src='https://raw.githubusercontent.com/sportsdataverse/cfb4th/main/man/figures/logo.png' align="right" width="25%" min-width="120px" /></a>
<!-- badges: start -->
[![Version-Number](https://img.shields.io/github/r-package/v/sportsdataverse/cfb4th?label=cfb4th&logo=R&style=for-the-badge)](https://github.com/sportsdataverse/cfb4th/)
[![R-CMD-check](https://img.shields.io/github/actions/workflow/status/sportsdataverse/cfb4th/R-CMD-check.yaml?branch=main&label=R-CMD-Check&logo=R&logoColor=white&style=for-the-badge)](https://github.com/sportsdataverse/cfb4th/actions/workflows/R-CMD-check.yaml)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg?style=for-the-badge&logo=github)](https://lifecycle.r-lib.org/articles/stages.html#experimental)[![Contributors](https://img.shields.io/github/contributors/sportsdataverse/cfb4th?style=for-the-badge)](https://github.com/sportsdataverse/cfb4th/graphs/contributors)
[![Twitter Follow](https://img.shields.io/twitter/follow/aisports_4th.svg?color=blue&label=%40aisports_4th&logo=twitter&style=for-the-badge)](https://twitter.com/aisports_4th)
<!-- badges: end -->
This is the package that powers the [A.I. Sports College Football 4th Down Model](https://kazink.shinyapps.io/cfb_fourth_down/) discussed in [this UteZone article.](https://247sports.com/college/utah/LongFormArticle/Utah-Fourth-Downs-2020-159851937/) The model is heavily based on the work and [code](https://www.nfl4th.com/) produced by [Ben Baldwin](https://twitter.com/benbbaldwin) for his [4th Down Calculator for the NFL](https://rbsdm.com/stats/fourth_calculator/)
## **Installation**
<!-- You can install the released version of cfb4th from [CRAN](https://CRAN.R-project.org) with: -->
<!-- ``` r -->
<!-- install.packages("cfb4th") -->
<!-- ``` -->
<!-- And the development version from [GitHub](https://github.com/) with: -->
<!-- ``` r -->
<!-- # install.packages("devtools") -->
<!-- devtools::install_github("sportsdataverse/cfb4th") -->
<!-- ``` -->
You can install the development version of cfb4th from [GitHub](https://github.com/sportsdataverse/cfb4th) with:
``` r
# install.packages("devtools")
devtools::install_github("sportsdataverse/cfb4th")
```
## **Features**
* The **go for it** model gives probabilities for possibilities of yards gained and includes the possibility of earning a first down via defensive penalty
* The **punt** model includes the possibility for getting blocked, returned for a touchdown, or fumbled on the return
* The **field goal** model is a simple model of field goal % by distance and roof type
## **Current limitations**
There are some edge cases that are not accounted for. These should only make a marginal difference to the recommendations as they are largely edge cases (e.g. the possibility for a field goal to be blocked and returned).
* The **go for it** model does not allow for the possibility of a turnover return. However, long returns are extremely rare: For example, in 2018 and 2019 in the NFL there were only four defensive touchdowns on plays where teams went for fourth downs out of 1,236 plays, and all of these happened when the game was well in hand for the other team. Additionally, it assumes that a touchdown is worth 7 points and doesn't account for go-for-2 situations (Future Work)
* The **punt** model doesn’t account for the punter or returner, ignores penalties on returns and ignores the potential for blocked punts to be returned for touchdowns
* The **field goal** model doesn’t account for who the kicker is, what the weather is (only relevant for outdoor games), or the possibility of a kick being blocked and returned for a touchdown
## **Get Started**
To get started with cfb4th please see [this article](https://cfb4th.sportsdataverse.org/articles/cfb4th.html).
* [The logic of the shiny app](https://github.com/Kazink36/cfb_fourth_down/blob/main/app.R)
* [The code that powers the bot](https://github.com/Kazink36/cfb_fourth_down/tree/main/bot)
* [The bot can be found on twitter here.](https://twitter.com/aisports_4th)
## **Our Authors**
- [Jared Lee](https://twitter.com/JaredDLee) </br>
<a href="https://twitter.com/JaredDLee" target="blank"><img src="https://img.shields.io/twitter/follow/JaredDLee?color=blue&label=%40JaredDLee&logo=twitter&style=for-the-badge" alt="@JaredDLee" /></a>
<a href="https://github.com/Kazink36" target="blank"><img src="https://img.shields.io/github/followers/Kazink36?color=eee&logo=Github&style=for-the-badge" alt="@Kazink36" /></a>
- [Sebastian Carl](https://twitter.com/mrcaseb)
<a href="https://twitter.com/mrcaseb" target="blank"><img src="https://img.shields.io/twitter/follow/mrcaseb?color=blue&label=%40mrcaseb&logo=twitter&style=for-the-badge" alt="@mrcaseb" /></a>
<a href="https://github.com/mrcaseb" target="blank"><img src="https://img.shields.io/github/followers/mrcaseb?color=eee&logo=Github&style=for-the-badge" alt="@mrcaseb" /></a>
- [Ben Baldwin](https://twitter.com/benbbaldwin)
<a href="https://twitter.com/benbbaldwin" target="blank"><img src="https://img.shields.io/twitter/follow/benbbaldwin?color=blue&label=%40benbbaldwin&logo=twitter&style=for-the-badge" alt="@benbbaldwin" /></a>
<a href="https://github.com/guga31bb" target="blank"><img src="https://img.shields.io/github/followers/guga31bb?color=eee&logo=Github&style=for-the-badge" alt="@guga31bb" /></a>
## **Citations**
To cite the [**`cfb4th`**](https://cfb4th.sportsdataverse.org/) R package in publications, use:
BibTex Citation
```bibtex
@misc{lee_et_al_2021_cfb4th,
author = {Jared Lee and Sebastian Carl and Ben Baldwin},
title = {cfb4th: The SportsDataverse's R Package for College Football 4th Down Modeling.},
url = {https://cfb4th.sportsdataverse.org/},
year = {2021}
}
```