You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Have you installed the latest development version of the package(s) in question?
I have installed the latest development version of the package.
If this is a data issue, have you tried clearing your nflverse cache?
I have cleared my nflverse cache and the issue persists.
What version of the package do you have?
nflfastR 4.6.0 4.6.0 4.6.0.9000 dev
Describe the bug
For 48 plays so far in 2023, I have identified that WP computed by nflfastR::build_nflfastR_pbp(game_id) does not match the WP archived in nflfastR::load_pbp(2023).
When this occurs, it appears to apply to games with OT. For instance:
In the REPREX is a short script that takes a few minutes to run. It compares the archived WP for every 2023 play against the computed WP. Any plays that mismatch within 6 digits are reported in the output.
Reprex
library(dplyr)
#clear cachenflreadr::.clear_cache()
#load 2023 season directly from archivepbp<-nflfastR::load_pbp(2023)
#get unique game_idsgame_ids<- unique(pbp$game_id)
# process game ids looking for mismatchesmismatch_dfs<- lapply(game_ids, function(game_id) {
#outputnflfastR:::user_message(paste0("Processing game ", game_id, "."), "todo")
#get subset of plays for the game specifiedarchived<- filter(pbp, game_id==game_id)
#compute value without filling output
suppressMessages({
computed<-nflfastR::build_nflfastR_pbp(game_id) %>%
as.data.frame()
})
#merge the two dataframes on common columnsmerged_df<- merge(archived, computed, by= c("game_id", "qtr", "drive", "play_id", "play_type"), suffixes= c("_archived", "_computed"))
#subset where 'wp' values are differentresult<- subset(merged_df, round(wp_archived, 6) != round(wp_computed, 6))
#output statusif (nrow(result) >0) {
nflfastR:::user_message(paste0("Processing game ", game_id, " has mismatches."), "info")
}else{
nflfastR:::user_message(paste0("Processing game ", game_id, "."), "done")
}
#return dataframedplyr::select(result, "game_id", "qtr", "drive", "play_id", "play_type", "wp_archived", "wp_computed")
})
#combining the mismatched dfscombined_results<- do.call(rbind, mismatch_dfs)
#output
print(combined_results, n=Inf)
Expected Behavior
I would expect the archived value to match the computed value.
Is there an existing issue for this?
Have you installed the latest development version of the package(s) in question?
If this is a data issue, have you tried clearing your nflverse cache?
I have cleared my nflverse cache and the issue persists.
What version of the package do you have?
nflfastR 4.6.0 4.6.0 4.6.0.9000 dev
Describe the bug
For 48 plays so far in 2023, I have identified that WP computed by nflfastR::build_nflfastR_pbp(game_id) does not match the WP archived in nflfastR::load_pbp(2023).
When this occurs, it appears to apply to games with OT. For instance:
1: 2023_01_BUF_NYJ 4 21 3882 0.5037537 0.3967606
2: 2023_01_BUF_NYJ 5 22 3902 kickoff 0.5037537 0.3967606
3: 2023_01_BUF_NYJ 5 22 3918 no_play 0.5037537 0.3967606
4: 2023_01_BUF_NYJ 5 22 3942 pass 0.4389834 0.3538505
5: 2023_01_BUF_NYJ 5 22 3965 run 0.3915674 0.3144271
6: 2023_01_BUF_NYJ 5 22 3987 pass 0.3318032 0.2638814
7: 2023_01_BUF_NYJ 5 22 4010 punt 0.2552552 0.2038933
8: 2023_02_LAC_TEN 4 NA 3966 0.5037537 0.3967606
9: 2023_02_LAC_TEN 5 21 3985 kickoff 0.5037537 0.3967606
10: 2023_02_LAC_TEN 5 21 4001 pass 0.5037537 0.3967606
11: 2023_02_LAC_TEN 5 21 4024 pass 0.4562042 0.3605613
12: 2023_02_LAC_TEN 5 21 4047 pass 0.3898785 0.3070003
13: 2023_02_LAC_TEN 5 21 4070 punt 0.2804652 0.2217094
In the REPREX is a short script that takes a few minutes to run. It compares the archived WP for every 2023 play against the computed WP. Any plays that mismatch within 6 digits are reported in the output.
Reprex
Expected Behavior
I would expect the archived value to match the computed value.
nflverse_sitrep
Screenshots
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: