diff --git a/NEWS.md b/NEWS.md index 16178f928..0303896b4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -484,6 +484,16 @@ the `httr2` and `testthat` floors (see Dependencies). (#84) * `load_ncaa_wbb_rapm_within_team()` documented `rapm_net` as `rapm_off + rapm_def`. The data has `rapm_net = rapm_off - rapm_def`, because `rapm_def` is on a points-allowed scale (lower is better). The docs now say so. +* The returns tables of the three model loaders now list every column of the published files: + `load_wnba_player_impact()` 76 (was 28; adds the `_n`, `_rank` and `_pct` columns of each + of the 16 ratings), `load_wbb_ratings()` 16 (was 11; adds `adj_o_blend`, `adj_d_blend`, + `adj_em_blend`, `rank_blend` and `prior_games`) and `load_wbb_player_value()` 9 (was 8; adds + `qualified`). `o_adj_rapm` / `d_adj_rapm` were documented as adjusted for minutes/possession + stability; they are RAPM with a ridge prior toward SPM (last season's in the regular season, + this season's regular-season SPM in the playoffs). `load_wbb_player_value()` documented + `player_id` as a stats.ncaa.org id; it is the ESPN athlete id. The team-ratings and + player-value articles no longer say 2015 is missing, that there is no preseason prior, or that + older files lack `qualified`. * The installed help is a third smaller (4.4 MB to 3.0 MB). The help pages of the 9 largest function families (ESPN WNBA and WBB, WNBA Player and Team, FIBA, TBF, SCB, NBL Rosetta, WJBL) link to one family index page (`?family_espn_wnba`, `?family_tbf`, ...) in "See also" diff --git a/R/load_models.R b/R/load_models.R index f6ac41a35..fb33a7783 100644 --- a/R/load_models.R +++ b/R/load_models.R @@ -10,7 +10,7 @@ #' @rdname load_wbb_player_value #' @author Saiem Gilani #' @description Loads season-level WNBA player-impact ratings -- one row per -#' player-team-season, combining regularized adjusted plus-minus (RAPM), +#' player, team, season and season type, combining regularized adjusted plus-minus (RAPM), #' statistical plus-minus (SPM), box plus-minus (BPM), wins above #' replacement (WAR), and a DARKO-style skill/projection pair. Produced by #' the sportsdataverse-py NBA/WNBA possession-engine model program; published to the @@ -29,7 +29,14 @@ #' the season data into a database. #' @param dbConnection A `DBIConnection` object, as returned by [DBI::dbConnect()] #' @param tablename The name of the data table within the database -#' @return Returns a `wehoop_data` tibble with one row per player-team-season. +#' @return `load_wnba_player_impact()` returns a `wehoop_data` tibble with one +#' row per player, team, season and season type (`Regular Season` and +#' `Playoffs` rows are separate). +#' Each of the 16 ratings gets an `_n` (sample size), `_rank` and `_pct` +#' column, computed within each season and season type. The sample gates +#' are regular-season sized: in the published 1997-2026 files no season has +#' 10 playoff players past a gate, so every playoff `_rank` and `_pct` is +#' null except `war_rank` and `war_pct`. #' #' \if{html}{\tabular{lll}{ #' col_name \tab types \tab description \cr @@ -46,8 +53,8 @@ #' rapm \tab numeric \tab Net regularized adjusted plus-minus (o_rapm + d_rapm). \cr #' off_poss \tab integer \tab Offensive possessions used in the RAPM fit. \cr #' def_poss \tab integer \tab Defensive possessions used in the RAPM fit. \cr -#' o_adj_rapm \tab numeric \tab Offensive RAPM adjusted for minutes/possession stability. \cr -#' d_adj_rapm \tab numeric \tab Defensive RAPM adjusted for minutes/possession stability. \cr +#' o_adj_rapm \tab numeric \tab Offensive RAPM fitted with a ridge prior toward SPM instead of zero: the previous season's SPM in the regular season, the same season's regular-season SPM in the playoffs. A player with no prior (a first season, or after a gap) is shrunk toward zero. \cr +#' d_adj_rapm \tab numeric \tab Defensive RAPM fitted with a ridge prior toward SPM instead of zero: the previous season's SPM in the regular season, the same season's regular-season SPM in the playoffs. A player with no prior (a first season, or after a gap) is shrunk toward zero. \cr #' adj_rapm \tab numeric \tab Net adjusted RAPM (o_adj_rapm + d_adj_rapm). \cr #' ospm \tab numeric \tab Offensive statistical plus-minus (box-score component). \cr #' dspm \tab numeric \tab Defensive statistical plus-minus (box-score component). \cr @@ -61,6 +68,54 @@ #' boban_filtered_skill \tab numeric \tab DARKO-style filtered skill rating. \cr #' boban_projected_rating \tab numeric \tab DARKO-style forward-looking projected rating. \cr #' boban_projected_sd \tab numeric \tab Standard deviation of the DARKO-style projected rating. \cr +#' o_rapm_n \tab integer \tab Possessions o_rapm is measured over (off_poss). Its rank and percentile are set only when it reaches 610, the WNBA sample at which an offensive on-court rating is half signal. \cr +#' d_rapm_n \tab integer \tab Possessions d_rapm is measured over (def_poss). Its rank and percentile are set only when it reaches 1,200, the WNBA sample at which a defensive on-court rating is half signal. \cr +#' rapm_n \tab integer \tab Possessions rapm is measured over (off_poss + def_poss). Its rank and percentile are set only when it reaches 1,600, the WNBA sample at which a net on-court rating is half signal. \cr +#' o_adj_rapm_n \tab integer \tab Possessions o_adj_rapm is measured over (off_poss). Its rank and percentile are set only when it reaches 610, the WNBA sample at which an offensive on-court rating is half signal. \cr +#' d_adj_rapm_n \tab integer \tab Possessions d_adj_rapm is measured over (def_poss). Its rank and percentile are set only when it reaches 1,200, the WNBA sample at which a defensive on-court rating is half signal. \cr +#' adj_rapm_n \tab integer \tab Possessions adj_rapm is measured over (off_poss + def_poss). Its rank and percentile are set only when it reaches 1,600, the WNBA sample at which a net on-court rating is half signal. \cr +#' ospm_n \tab integer \tab Possessions ospm is measured over (off_poss). Its rank and percentile are set only when it reaches 610, the WNBA sample at which an offensive on-court rating is half signal. \cr +#' dspm_n \tab integer \tab Possessions dspm is measured over (def_poss). Its rank and percentile are set only when it reaches 1,200, the WNBA sample at which a defensive on-court rating is half signal. \cr +#' spm_n \tab integer \tab Possessions spm is measured over (off_poss + def_poss). Its rank and percentile are set only when it reaches 1,600, the WNBA sample at which a net on-court rating is half signal. \cr +#' obpm_n \tab integer \tab Possessions obpm is measured over (off_poss). Its rank and percentile are set only when it reaches 610, the WNBA sample at which an offensive on-court rating is half signal. \cr +#' dbpm_n \tab integer \tab Possessions dbpm is measured over (def_poss). Its rank and percentile are set only when it reaches 1,200, the WNBA sample at which a defensive on-court rating is half signal. \cr +#' bpm_n \tab integer \tab Possessions bpm is measured over (off_poss + def_poss). Its rank and percentile are set only when it reaches 1,600, the WNBA sample at which a net on-court rating is half signal. \cr +#' war_n \tab integer \tab Possessions behind war (off_poss + def_poss). war is a count, not a rate, so its rank has no sample gate. \cr +#' boban_filtered_skill_n \tab integer \tab Possessions behind boban_filtered_skill (off_poss + def_poss this season). A multi-season estimate takes the net gate: its rank and percentile are set only when it reaches 1,600. \cr +#' boban_projected_rating_n \tab integer \tab Possessions behind boban_projected_rating (off_poss + def_poss this season). A multi-season estimate takes the net gate: its rank and percentile are set only when it reaches 1,600. \cr +#' boban_projected_sd_n \tab integer \tab Possessions behind boban_projected_sd (off_poss + def_poss this season). A multi-season estimate takes the net gate: its rank and percentile are set only when it reaches 1,600. \cr +#' o_rapm_rank \tab numeric \tab Rank of o_rapm within the season and season type, 1 = best, ties averaged. Null when o_rapm is null, o_rapm_n is under 610, or fewer than 10 players are ranked. \cr +#' d_rapm_rank \tab numeric \tab Rank of d_rapm within the season and season type, 1 = best, ties averaged. Null when d_rapm is null, d_rapm_n is under 1,200, or fewer than 10 players are ranked. \cr +#' rapm_rank \tab numeric \tab Rank of rapm within the season and season type, 1 = best, ties averaged. Null when rapm is null, rapm_n is under 1,600, or fewer than 10 players are ranked. \cr +#' o_adj_rapm_rank \tab numeric \tab Rank of o_adj_rapm within the season and season type, 1 = best, ties averaged. Null when o_adj_rapm is null, o_adj_rapm_n is under 610, or fewer than 10 players are ranked. \cr +#' d_adj_rapm_rank \tab numeric \tab Rank of d_adj_rapm within the season and season type, 1 = best, ties averaged. Null when d_adj_rapm is null, d_adj_rapm_n is under 1,200, or fewer than 10 players are ranked. \cr +#' adj_rapm_rank \tab numeric \tab Rank of adj_rapm within the season and season type, 1 = best, ties averaged. Null when adj_rapm is null, adj_rapm_n is under 1,600, or fewer than 10 players are ranked. \cr +#' ospm_rank \tab numeric \tab Rank of ospm within the season and season type, 1 = best, ties averaged. Null when ospm is null, ospm_n is under 610, or fewer than 10 players are ranked. \cr +#' dspm_rank \tab numeric \tab Rank of dspm within the season and season type, 1 = best, ties averaged. Null when dspm is null, dspm_n is under 1,200, or fewer than 10 players are ranked. \cr +#' spm_rank \tab numeric \tab Rank of spm within the season and season type, 1 = best, ties averaged. Null when spm is null, spm_n is under 1,600, or fewer than 10 players are ranked. \cr +#' obpm_rank \tab numeric \tab Rank of obpm within the season and season type, 1 = best, ties averaged. Null when obpm is null, obpm_n is under 610, or fewer than 10 players are ranked. \cr +#' dbpm_rank \tab numeric \tab Rank of dbpm within the season and season type, 1 = best, ties averaged. Null when dbpm is null, dbpm_n is under 1,200, or fewer than 10 players are ranked. \cr +#' bpm_rank \tab numeric \tab Rank of bpm within the season and season type, 1 = best, ties averaged. Null when bpm is null, bpm_n is under 1,600, or fewer than 10 players are ranked. \cr +#' war_rank \tab numeric \tab Rank of war within the season and season type, 1 = best, ties averaged. Ungated; null when war is null or fewer than 10 players are ranked. \cr +#' boban_filtered_skill_rank \tab numeric \tab Rank of boban_filtered_skill within the season and season type, 1 = best, ties averaged. Null when boban_filtered_skill is null, boban_filtered_skill_n is under 1,600, or fewer than 10 players are ranked. \cr +#' boban_projected_rating_rank \tab numeric \tab Rank of boban_projected_rating within the season and season type, 1 = best, ties averaged. Null when boban_projected_rating is null, boban_projected_rating_n is under 1,600, or fewer than 10 players are ranked. \cr +#' boban_projected_sd_rank \tab numeric \tab Rank of boban_projected_sd within the season and season type, ascending: 1 = the smallest sd (the most certain projection), ties averaged. Null when boban_projected_sd is null, boban_projected_sd_n is under 1,600, or fewer than 10 players are ranked. \cr +#' o_rapm_pct \tab numeric \tab Percentile of o_rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' d_rapm_pct \tab numeric \tab Percentile of d_rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' rapm_pct \tab numeric \tab Percentile of rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' o_adj_rapm_pct \tab numeric \tab Percentile of o_adj_rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' d_adj_rapm_pct \tab numeric \tab Percentile of d_adj_rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' adj_rapm_pct \tab numeric \tab Percentile of adj_rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' ospm_pct \tab numeric \tab Percentile of ospm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' dspm_pct \tab numeric \tab Percentile of dspm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' spm_pct \tab numeric \tab Percentile of spm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' obpm_pct \tab numeric \tab Percentile of obpm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' dbpm_pct \tab numeric \tab Percentile of dbpm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' bpm_pct \tab numeric \tab Percentile of bpm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' war_pct \tab numeric \tab Percentile of war_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' boban_filtered_skill_pct \tab numeric \tab Percentile of boban_filtered_skill_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' boban_projected_rating_pct \tab numeric \tab Percentile of boban_projected_rating_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr +#' boban_projected_sd_pct \tab numeric \tab Percentile of boban_projected_sd_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players: high means a more certain projection. Null where the rank is. \cr #' }} #' \if{latex}{See the HTML help or pkgdown reference for the column table.} #' @@ -124,11 +179,12 @@ NULL #' the season data into a database. #' @param dbConnection A `DBIConnection` object, as returned by [DBI::dbConnect()] #' @param tablename The name of the data table within the database -#' @return Returns a `wehoop_data` tibble with one row per player-team-season. +#' @return `load_wbb_player_value()` returns a `wehoop_data` tibble with one +#' row per player-team-season. #' #' \if{html}{\tabular{lll}{ #' col_name \tab types \tab description \cr -#' player_id \tab character \tab stats.ncaa.org player identifier. \cr +#' player_id \tab character \tab ESPN athlete identifier (the box score's athlete_id, as a string). \cr #' player \tab character \tab Player display name (title-cased). \cr #' season \tab integer \tab Season identifier (4-digit season-ending year). \cr #' team_id \tab character \tab Unique team identifier. \cr @@ -136,6 +192,7 @@ NULL #' box_obpm \tab numeric \tab Box-score offensive box plus-minus. \cr #' box_dbpm \tab numeric \tab Box-score defensive box plus-minus. \cr #' box_bpm \tab numeric \tab Box-score net box plus-minus (box_obpm + box_dbpm). \cr +#' qualified \tab logical \tab TRUE when min is at least 300, the floor where the spread of box_bpm first sits within 2% of its high-minute plateau. An additive flag: no row is dropped. \cr #' }} #' \if{latex}{See the HTML help or pkgdown reference for the column table.} #' @@ -188,15 +245,17 @@ load_wbb_player_value <- function(seasons = most_recent_wbb_season(), #' @description Loads season-level NCAA women's college basketball team #' ratings -- one row per team-season, with adjusted #' (opponent-strength-normalized) offensive/defensive efficiency, adjusted -#' tempo, raw efficiency, and a national rank. A KenPom-style -#' adjusted-efficiency-margin rating. This tag is parquet-only, with no +#' tempo, raw efficiency, and a rank by adj_em over every team in the file +#' (including non-Division I opponents), solved as an iterative fixed +#' point. This tag is parquet-only, with no #' csv/rds sibling assets. Produced by the sportsdataverse-py NCAA WBB model program; #' published to the `wbb_ratings` release tag. #' @param ... Additional arguments passed to an underlying function that writes #' the season data into a database. #' @param dbConnection A `DBIConnection` object, as returned by [DBI::dbConnect()] #' @param tablename The name of the data table within the database -#' @return Returns a `wehoop_data` tibble with one row per team-season. +#' @return `load_wbb_ratings()` returns a `wehoop_data` tibble with one row per +#' team-season. #' #' \if{html}{\tabular{lll}{ #' col_name \tab types \tab description \cr @@ -209,8 +268,13 @@ load_wbb_player_value <- function(seasons = most_recent_wbb_season(), #' raw_o \tab numeric \tab Unadjusted (raw) offensive efficiency. \cr #' raw_d \tab numeric \tab Unadjusted (raw) defensive efficiency. \cr #' games \tab integer \tab Games played (season total). \cr -#' rank \tab integer \tab National rank by adj_em. \cr +#' rank \tab integer \tab Rank by adj_em among every team in the file (dense, 1 = best; includes non-Division I opponents). \cr #' adj_em_z \tab numeric \tab Z-score of adj_em relative to the season's team distribution. \cr +#' adj_o_blend \tab numeric \tab Adjusted offensive efficiency with the preseason prior blended in: the same fixed point as adj_o, with each Division I team shrunk toward last season's regressed rating as if it had played prior_games extra games at it. A team new to Division I (or with no rated game last season) is shrunk toward the 23rd percentile of last season's Division I adj_em instead. Non-Division I opponents get no prior; their values move only through their Division I opponents. \cr +#' adj_d_blend \tab numeric \tab Adjusted defensive efficiency with the preseason prior blended in, on the same basis as adj_o_blend (lower is better). \cr +#' adj_em_blend \tab numeric \tab adj_o_blend minus adj_d_blend. A team with g games is rated about g / (g + prior_games) on this season. \cr +#' rank_blend \tab integer \tab Rank by adj_em_blend among every team in the file (dense, 1 = best; includes non-Division I opponents). \cr +#' prior_games \tab numeric \tab Weight of the preseason prior, in games (3). 0 when the previous season has no ratable games (2009); the blend then equals the unblended rating. \cr #' }} #' \if{latex}{See the HTML help or pkgdown reference for the column table.} #' diff --git a/man/load_wbb_player_value.Rd b/man/load_wbb_player_value.Rd index c374564a0..b974ff893 100644 --- a/man/load_wbb_player_value.Rd +++ b/man/load_wbb_player_value.Rd @@ -54,7 +54,14 @@ the season data into a database.} \item{tablename}{The name of the data table within the database} } \value{ -Returns a \code{wehoop_data} tibble with one row per player-team-season. +\code{load_wnba_player_impact()} returns a \code{wehoop_data} tibble with one +row per player, team, season and season type (\verb{Regular Season} and +\code{Playoffs} rows are separate). +Each of the 16 ratings gets an \verb{_n} (sample size), \verb{_rank} and \verb{_pct} +column, computed within each season and season type. The sample gates +are regular-season sized: in the published 1997-2026 files no season has +10 playoff players past a gate, so every playoff \verb{_rank} and \verb{_pct} is +null except \code{war_rank} and \code{war_pct}. \if{html}{\tabular{lll}{ col_name \tab types \tab description \cr @@ -71,8 +78,8 @@ Returns a \code{wehoop_data} tibble with one row per player-team-season. rapm \tab numeric \tab Net regularized adjusted plus-minus (o_rapm + d_rapm). \cr off_poss \tab integer \tab Offensive possessions used in the RAPM fit. \cr def_poss \tab integer \tab Defensive possessions used in the RAPM fit. \cr - o_adj_rapm \tab numeric \tab Offensive RAPM adjusted for minutes/possession stability. \cr - d_adj_rapm \tab numeric \tab Defensive RAPM adjusted for minutes/possession stability. \cr + o_adj_rapm \tab numeric \tab Offensive RAPM fitted with a ridge prior toward SPM instead of zero: the previous season's SPM in the regular season, the same season's regular-season SPM in the playoffs. A player with no prior (a first season, or after a gap) is shrunk toward zero. \cr + d_adj_rapm \tab numeric \tab Defensive RAPM fitted with a ridge prior toward SPM instead of zero: the previous season's SPM in the regular season, the same season's regular-season SPM in the playoffs. A player with no prior (a first season, or after a gap) is shrunk toward zero. \cr adj_rapm \tab numeric \tab Net adjusted RAPM (o_adj_rapm + d_adj_rapm). \cr ospm \tab numeric \tab Offensive statistical plus-minus (box-score component). \cr dspm \tab numeric \tab Defensive statistical plus-minus (box-score component). \cr @@ -86,14 +93,63 @@ Returns a \code{wehoop_data} tibble with one row per player-team-season. boban_filtered_skill \tab numeric \tab DARKO-style filtered skill rating. \cr boban_projected_rating \tab numeric \tab DARKO-style forward-looking projected rating. \cr boban_projected_sd \tab numeric \tab Standard deviation of the DARKO-style projected rating. \cr + o_rapm_n \tab integer \tab Possessions o_rapm is measured over (off_poss). Its rank and percentile are set only when it reaches 610, the WNBA sample at which an offensive on-court rating is half signal. \cr + d_rapm_n \tab integer \tab Possessions d_rapm is measured over (def_poss). Its rank and percentile are set only when it reaches 1,200, the WNBA sample at which a defensive on-court rating is half signal. \cr + rapm_n \tab integer \tab Possessions rapm is measured over (off_poss + def_poss). Its rank and percentile are set only when it reaches 1,600, the WNBA sample at which a net on-court rating is half signal. \cr + o_adj_rapm_n \tab integer \tab Possessions o_adj_rapm is measured over (off_poss). Its rank and percentile are set only when it reaches 610, the WNBA sample at which an offensive on-court rating is half signal. \cr + d_adj_rapm_n \tab integer \tab Possessions d_adj_rapm is measured over (def_poss). Its rank and percentile are set only when it reaches 1,200, the WNBA sample at which a defensive on-court rating is half signal. \cr + adj_rapm_n \tab integer \tab Possessions adj_rapm is measured over (off_poss + def_poss). Its rank and percentile are set only when it reaches 1,600, the WNBA sample at which a net on-court rating is half signal. \cr + ospm_n \tab integer \tab Possessions ospm is measured over (off_poss). Its rank and percentile are set only when it reaches 610, the WNBA sample at which an offensive on-court rating is half signal. \cr + dspm_n \tab integer \tab Possessions dspm is measured over (def_poss). Its rank and percentile are set only when it reaches 1,200, the WNBA sample at which a defensive on-court rating is half signal. \cr + spm_n \tab integer \tab Possessions spm is measured over (off_poss + def_poss). Its rank and percentile are set only when it reaches 1,600, the WNBA sample at which a net on-court rating is half signal. \cr + obpm_n \tab integer \tab Possessions obpm is measured over (off_poss). Its rank and percentile are set only when it reaches 610, the WNBA sample at which an offensive on-court rating is half signal. \cr + dbpm_n \tab integer \tab Possessions dbpm is measured over (def_poss). Its rank and percentile are set only when it reaches 1,200, the WNBA sample at which a defensive on-court rating is half signal. \cr + bpm_n \tab integer \tab Possessions bpm is measured over (off_poss + def_poss). Its rank and percentile are set only when it reaches 1,600, the WNBA sample at which a net on-court rating is half signal. \cr + war_n \tab integer \tab Possessions behind war (off_poss + def_poss). war is a count, not a rate, so its rank has no sample gate. \cr + boban_filtered_skill_n \tab integer \tab Possessions behind boban_filtered_skill (off_poss + def_poss this season). A multi-season estimate takes the net gate: its rank and percentile are set only when it reaches 1,600. \cr + boban_projected_rating_n \tab integer \tab Possessions behind boban_projected_rating (off_poss + def_poss this season). A multi-season estimate takes the net gate: its rank and percentile are set only when it reaches 1,600. \cr + boban_projected_sd_n \tab integer \tab Possessions behind boban_projected_sd (off_poss + def_poss this season). A multi-season estimate takes the net gate: its rank and percentile are set only when it reaches 1,600. \cr + o_rapm_rank \tab numeric \tab Rank of o_rapm within the season and season type, 1 = best, ties averaged. Null when o_rapm is null, o_rapm_n is under 610, or fewer than 10 players are ranked. \cr + d_rapm_rank \tab numeric \tab Rank of d_rapm within the season and season type, 1 = best, ties averaged. Null when d_rapm is null, d_rapm_n is under 1,200, or fewer than 10 players are ranked. \cr + rapm_rank \tab numeric \tab Rank of rapm within the season and season type, 1 = best, ties averaged. Null when rapm is null, rapm_n is under 1,600, or fewer than 10 players are ranked. \cr + o_adj_rapm_rank \tab numeric \tab Rank of o_adj_rapm within the season and season type, 1 = best, ties averaged. Null when o_adj_rapm is null, o_adj_rapm_n is under 610, or fewer than 10 players are ranked. \cr + d_adj_rapm_rank \tab numeric \tab Rank of d_adj_rapm within the season and season type, 1 = best, ties averaged. Null when d_adj_rapm is null, d_adj_rapm_n is under 1,200, or fewer than 10 players are ranked. \cr + adj_rapm_rank \tab numeric \tab Rank of adj_rapm within the season and season type, 1 = best, ties averaged. Null when adj_rapm is null, adj_rapm_n is under 1,600, or fewer than 10 players are ranked. \cr + ospm_rank \tab numeric \tab Rank of ospm within the season and season type, 1 = best, ties averaged. Null when ospm is null, ospm_n is under 610, or fewer than 10 players are ranked. \cr + dspm_rank \tab numeric \tab Rank of dspm within the season and season type, 1 = best, ties averaged. Null when dspm is null, dspm_n is under 1,200, or fewer than 10 players are ranked. \cr + spm_rank \tab numeric \tab Rank of spm within the season and season type, 1 = best, ties averaged. Null when spm is null, spm_n is under 1,600, or fewer than 10 players are ranked. \cr + obpm_rank \tab numeric \tab Rank of obpm within the season and season type, 1 = best, ties averaged. Null when obpm is null, obpm_n is under 610, or fewer than 10 players are ranked. \cr + dbpm_rank \tab numeric \tab Rank of dbpm within the season and season type, 1 = best, ties averaged. Null when dbpm is null, dbpm_n is under 1,200, or fewer than 10 players are ranked. \cr + bpm_rank \tab numeric \tab Rank of bpm within the season and season type, 1 = best, ties averaged. Null when bpm is null, bpm_n is under 1,600, or fewer than 10 players are ranked. \cr + war_rank \tab numeric \tab Rank of war within the season and season type, 1 = best, ties averaged. Ungated; null when war is null or fewer than 10 players are ranked. \cr + boban_filtered_skill_rank \tab numeric \tab Rank of boban_filtered_skill within the season and season type, 1 = best, ties averaged. Null when boban_filtered_skill is null, boban_filtered_skill_n is under 1,600, or fewer than 10 players are ranked. \cr + boban_projected_rating_rank \tab numeric \tab Rank of boban_projected_rating within the season and season type, 1 = best, ties averaged. Null when boban_projected_rating is null, boban_projected_rating_n is under 1,600, or fewer than 10 players are ranked. \cr + boban_projected_sd_rank \tab numeric \tab Rank of boban_projected_sd within the season and season type, ascending: 1 = the smallest sd (the most certain projection), ties averaged. Null when boban_projected_sd is null, boban_projected_sd_n is under 1,600, or fewer than 10 players are ranked. \cr + o_rapm_pct \tab numeric \tab Percentile of o_rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + d_rapm_pct \tab numeric \tab Percentile of d_rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + rapm_pct \tab numeric \tab Percentile of rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + o_adj_rapm_pct \tab numeric \tab Percentile of o_adj_rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + d_adj_rapm_pct \tab numeric \tab Percentile of d_adj_rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + adj_rapm_pct \tab numeric \tab Percentile of adj_rapm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + ospm_pct \tab numeric \tab Percentile of ospm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + dspm_pct \tab numeric \tab Percentile of dspm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + spm_pct \tab numeric \tab Percentile of spm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + obpm_pct \tab numeric \tab Percentile of obpm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + dbpm_pct \tab numeric \tab Percentile of dbpm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + bpm_pct \tab numeric \tab Percentile of bpm_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + war_pct \tab numeric \tab Percentile of war_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + boban_filtered_skill_pct \tab numeric \tab Percentile of boban_filtered_skill_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + boban_projected_rating_pct \tab numeric \tab Percentile of boban_projected_rating_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players; null where the rank is. \cr + boban_projected_sd_pct \tab numeric \tab Percentile of boban_projected_sd_rank, 100 x (n + 1 - rank) / (n + 1) over the n ranked players: high means a more certain projection. Null where the rank is. \cr }} \if{latex}{See the HTML help or pkgdown reference for the column table.} -Returns a \code{wehoop_data} tibble with one row per player-team-season. +\code{load_wbb_player_value()} returns a \code{wehoop_data} tibble with one +row per player-team-season. \if{html}{\tabular{lll}{ col_name \tab types \tab description \cr - player_id \tab character \tab stats.ncaa.org player identifier. \cr + player_id \tab character \tab ESPN athlete identifier (the box score's athlete_id, as a string). \cr player \tab character \tab Player display name (title-cased). \cr season \tab integer \tab Season identifier (4-digit season-ending year). \cr team_id \tab character \tab Unique team identifier. \cr @@ -101,10 +157,12 @@ Returns a \code{wehoop_data} tibble with one row per player-team-season. box_obpm \tab numeric \tab Box-score offensive box plus-minus. \cr box_dbpm \tab numeric \tab Box-score defensive box plus-minus. \cr box_bpm \tab numeric \tab Box-score net box plus-minus (box_obpm + box_dbpm). \cr + qualified \tab logical \tab TRUE when min is at least 300, the floor where the spread of box_bpm first sits within 2% of its high-minute plateau. An additive flag: no row is dropped. \cr }} \if{latex}{See the HTML help or pkgdown reference for the column table.} -Returns a \code{wehoop_data} tibble with one row per team-season. +\code{load_wbb_ratings()} returns a \code{wehoop_data} tibble with one row per +team-season. \if{html}{\tabular{lll}{ col_name \tab types \tab description \cr @@ -117,14 +175,19 @@ Returns a \code{wehoop_data} tibble with one row per team-season. raw_o \tab numeric \tab Unadjusted (raw) offensive efficiency. \cr raw_d \tab numeric \tab Unadjusted (raw) defensive efficiency. \cr games \tab integer \tab Games played (season total). \cr - rank \tab integer \tab National rank by adj_em. \cr + rank \tab integer \tab Rank by adj_em among every team in the file (dense, 1 = best; includes non-Division I opponents). \cr adj_em_z \tab numeric \tab Z-score of adj_em relative to the season's team distribution. \cr + adj_o_blend \tab numeric \tab Adjusted offensive efficiency with the preseason prior blended in: the same fixed point as adj_o, with each Division I team shrunk toward last season's regressed rating as if it had played prior_games extra games at it. A team new to Division I (or with no rated game last season) is shrunk toward the 23rd percentile of last season's Division I adj_em instead. Non-Division I opponents get no prior; their values move only through their Division I opponents. \cr + adj_d_blend \tab numeric \tab Adjusted defensive efficiency with the preseason prior blended in, on the same basis as adj_o_blend (lower is better). \cr + adj_em_blend \tab numeric \tab adj_o_blend minus adj_d_blend. A team with g games is rated about g / (g + prior_games) on this season. \cr + rank_blend \tab integer \tab Rank by adj_em_blend among every team in the file (dense, 1 = best; includes non-Division I opponents). \cr + prior_games \tab numeric \tab Weight of the preseason prior, in games (3). 0 when the previous season has no ratable games (2009); the blend then equals the unblended rating. \cr }} \if{latex}{See the HTML help or pkgdown reference for the column table.} } \description{ Loads season-level WNBA player-impact ratings -- one row per -player-team-season, combining regularized adjusted plus-minus (RAPM), +player, team, season and season type, combining regularized adjusted plus-minus (RAPM), statistical plus-minus (SPM), box plus-minus (BPM), wins above replacement (WAR), and a DARKO-style skill/projection pair. Produced by the sportsdataverse-py NBA/WNBA possession-engine model program; published to the @@ -141,8 +204,9 @@ published to the \code{wbb_player_value} release tag. Loads season-level NCAA women's college basketball team ratings -- one row per team-season, with adjusted (opponent-strength-normalized) offensive/defensive efficiency, adjusted -tempo, raw efficiency, and a national rank. A KenPom-style -adjusted-efficiency-margin rating. This tag is parquet-only, with no +tempo, raw efficiency, and a rank by adj_em over every team in the file +(including non-Division I opponents), solved as an iterative fixed +point. This tag is parquet-only, with no csv/rds sibling assets. Produced by the sportsdataverse-py NCAA WBB model program; published to the \code{wbb_ratings} release tag. } diff --git a/vignettes/articles/wnba-player-impact-model.Rmd b/vignettes/articles/wnba-player-impact-model.Rmd index 16db85393..7c15e29d7 100644 --- a/vignettes/articles/wnba-player-impact-model.Rmd +++ b/vignettes/articles/wnba-player-impact-model.Rmd @@ -32,7 +32,9 @@ This article explains what each engine estimates, how the suite is built, how well it holds up out of sample, and where it is weakest. It condenses the official model card in the [wehoop-wnba-stats-data repository](https://github.com/sportsdataverse/wehoop-wnba-stats-data/blob/main/docs/models/player_impact.md); -numbers quoted from that card are labelled as such. +numbers quoted from that card are labelled as such. The card gives the adj-RAPM +prior as the previous season's SPM only; it omits the playoff case, where playoff +rows use the same season's regular-season SPM. ## What the model estimates @@ -42,7 +44,7 @@ average player, split into offense and defense, except WAR, which counts wins. | Engine | Columns | What it measures | |---|---|---| | RAPM | `o_rapm`, `d_rapm`, `rapm` | Regularized adjusted plus-minus: a ridge regression of possession outcomes on the ten players on the court | -| adj-RAPM | `o_adj_rapm`, `d_adj_rapm`, `adj_rapm` | RAPM with a prior from the previous season's SPM, instead of shrinking every player to zero | +| adj-RAPM | `o_adj_rapm`, `d_adj_rapm`, `adj_rapm` | RAPM with a prior from SPM instead of zero: last season's in the regular season, this season's regular-season SPM in the playoffs | | SPM | `ospm`, `dspm`, `spm` | Statistical plus-minus: box score rates weighted by coefficients fitted to regular-season RAPM | | BPM | `obpm`, `dbpm`, `bpm` | Box plus-minus (BPM 2.0 design) from box score logs and listed positions | | WAR | `war` | Wins above replacement: the RAPM rating times a calibrated points-per-win, with replacement level at -2.0 | @@ -113,8 +115,9 @@ in time. roughly 15-game sample would train noise on noise. The fitted coefficients ship beside the release as `wnba_player_impact_spm_coefficients.json`. 4. **adj-RAPM.** RAPM again, but each player is shrunk toward her previous - season's SPM rather than toward zero. A gap season deliberately breaks the - prior chain. + season's SPM rather than toward zero (in the playoffs, toward that season's + regular-season SPM). A player with no prior is still shrunk toward zero, and + a gap season deliberately breaks the prior chain. 5. **BPM.** A box plus-minus from box score logs and listed positions. 6. **DARKO-style filter.** A per-season Kalman update over the RAPM panel with an aging curve. Playoff form enters as a possession-weighted blend rather diff --git a/vignettes/articles/womens-college-basketball-player-value-model.Rmd b/vignettes/articles/womens-college-basketball-player-value-model.Rmd index 45c72b0c4..188cea279 100644 --- a/vignettes/articles/womens-college-basketball-player-value-model.Rmd +++ b/vignettes/articles/womens-college-basketball-player-value-model.Rmd @@ -63,9 +63,6 @@ library(ggplot2) ```{r load} pv <- load_wbb_player_value(seasons = 2025:2026) -# Older release files predate the `qualified` flag; derive it the same way. -if (!"qualified" %in% names(pv)) pv$qualified <- pv$min >= 300 - pv |> count(season, qualified) ``` @@ -213,8 +210,7 @@ A correlation near zero means the two components are not restating each other. high-volume scorers. - **No shrinkage.** Low-minute values are unreliable; use the `qualified` flag. - **Team-anchored.** A player's BPM inherits her team's adjusted margin, so an - error in the team rating moves the whole roster. As reported in the cards, the - 2015 team ratings are missing, which leaves every 2015 player value empty. + error in the team rating moves the whole roster. - **Not yet blended with RAPM.** As reported in the card, a hybrid that uses BPM as a prior for RAPM is the planned next step. diff --git a/vignettes/articles/womens-college-basketball-team-ratings-model.Rmd b/vignettes/articles/womens-college-basketball-team-ratings-model.Rmd index 3035bb669..e21ac0983 100644 --- a/vignettes/articles/womens-college-basketball-team-ratings-model.Rmd +++ b/vignettes/articles/womens-college-basketball-team-ratings-model.Rmd @@ -42,7 +42,8 @@ numbers quoted from that card are labelled as such. | `adj_em_z` | `adj_em` as a z-score within the season | | `adj_tempo` | Adjusted possessions per 40 minutes | | `raw_o`, `raw_d` | Unadjusted points scored and allowed per 100 possessions | -| `games`, `rank` | Games in the fit and national rank by `adj_em` | +| `games`, `rank` | Games in the fit and a rank by `adj_em` over every team in the file (including non-Division I opponents) | +| `adj_o_blend`, `adj_d_blend`, `adj_em_blend`, `rank_blend`, `prior_games` | The same ratings with a `prior_games`-game preseason prior toward last season (3; 0 in 2009) | The design is the same family as the KenPom and Bart Torvik ratings that are standard in college basketball analysis. @@ -235,17 +236,19 @@ core |> ## Limitations and known issues -As reported in the model card: +As reported in the model card, updated for the current release files (the card +predates the preseason prior and the 2026-11-14 republish that fixed the 2015 +files): -- **2015 is missing.** The published 2015 file has no usable ratings (the fixed - point did not converge on that season's inputs), which also leaves the 2015 - player value file empty. A repair and republish is pending. - **Older seasons are thin.** Seasons before about 2017 have fewer teams with a full schedule in the box scores, and seasons before 2013 sit on a different - possession scale because of the older box score format. The 2008 file fails the - level gate. Use pre-2017 ratings with care. -- **No preseason prior.** Early-season ratings start from a flat slate, so they - are noisy until teams have played enough games. + possession scale because of the older box score format. A 2008 season was + computed but refused by the level gate, so the files start in 2009. Use + pre-2017 ratings with care. +- **A light preseason prior.** The unblended `adj_*` and `rank` columns start + from a flat slate, so they are noisy until teams have played enough games. Use + `adj_*_blend` / `rank_blend` for early-season ratings: a 3-game prior toward + last season (none in 2009, the first season). - **Home court and travel.** Altitude and travel distance are not modelled. ## Where to go next