Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yards_after_catch field is incorrect in pbp_pass #19

Closed
gheemony opened this issue Aug 8, 2024 · 1 comment · Fixed by #21
Closed

yards_after_catch field is incorrect in pbp_pass #19

gheemony opened this issue Aug 8, 2024 · 1 comment · Fixed by #21

Comments

@gheemony
Copy link

gheemony commented Aug 8, 2024

The yards_after_catch field in pbp_pass is incorrect. It is currently a decimal between 0 and 1. Based on the data dictionary, it hould be an integer equal to the difference between receiving_yards and air_yards. Reviewing the desc fields confirms this. In the weekly dataframe, the rec_air_yards and rec_yards_gained fields seem accurate, so this error seems limited to the pbp_pass.

library(tidyverse)
library(ffopportunity)

ep_load(
  season = nflreadr::most_recent_season(),
  type = "pbp_pass",
  version = "latest"
) %>% 
  select(yards_after_catch, air_yards, receiving_yards, desc, game_id, play_id) %>% 
  head(4)
#> → <ffopportunity predictions>
#> → Generated 2024-01-15 01:41:41.296844 with ep model version "latest"
#> # A tibble: 4 × 6
#>   yards_after_catch air_yards receiving_yards desc               game_id play_id
#>               <dbl>     <dbl>           <dbl> <chr>              <chr>     <dbl>
#> 1             0.661         6               6 (14:30) (Shotgun)… 2023_0…      77
#> 2             0.496        10              NA (13:16) (Shotgun)… 2023_0…     124
#> 3             0.563        12              12 (13:12) 14-S.Howe… 2023_0…     147
#> 4             0.484        -4 
@tanho63
Copy link
Member

tanho63 commented Aug 9, 2024

Looks like a bug. For the record, the model's predicted YAC is yards_after_catch_exp

tanho63 added a commit that referenced this issue Aug 9, 2024
@tanho63 tanho63 linked a pull request Aug 9, 2024 that will close this issue
tanho63 added a commit that referenced this issue Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants