stathead 0.3.2__tar.gz → 0.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: stathead
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: Python client for the StatHead fantasy football model — rookie career predictions, historical ADP, and flattened feature matrices.
5
5
  Project-URL: Homepage, https://github.com/dachhack/stathead
6
6
  Project-URL: Source, https://github.com/dachhack/stathead
@@ -154,7 +154,7 @@ available here as a pandas DataFrame.
154
154
  | Function | Returns | Shape |
155
155
  |---|---|---|
156
156
  | `load_redraft_projections()` | Seasonal redraft PPG (PPR) + receptions/game | ~250 × 7 |
157
- | `load_weekly_projections()` | Per-week matchup-adjusted projections, one row per player-game (opp, home, matchup mult, PPR pts; `df.attrs['def_vs_pos']`) | ~445 × 17 rows/player |
157
+ | `load_weekly_projections()` | Per-week matchup-adjusted projections incl. kickers + team DST, one row per player-game (opp, home, matchup mult, PPR pts, gsis/sleeper ids; `df.attrs['def_vs_pos']`) | ~509 × 17 rows/player |
158
158
  | `load_ppg_projections()` | Model-predicted PPG for established players | ~250 × 4 |
159
159
  | `load_adp_value_model()` | VOR vs ADP, hit probability, confidence interval | ~153 × 10 |
160
160
  | `load_volume_projections()` | Team pass/rush/target volumes with low/high bands | ~153 × ~14 |
@@ -126,7 +126,7 @@ available here as a pandas DataFrame.
126
126
  | Function | Returns | Shape |
127
127
  |---|---|---|
128
128
  | `load_redraft_projections()` | Seasonal redraft PPG (PPR) + receptions/game | ~250 × 7 |
129
- | `load_weekly_projections()` | Per-week matchup-adjusted projections, one row per player-game (opp, home, matchup mult, PPR pts; `df.attrs['def_vs_pos']`) | ~445 × 17 rows/player |
129
+ | `load_weekly_projections()` | Per-week matchup-adjusted projections incl. kickers + team DST, one row per player-game (opp, home, matchup mult, PPR pts, gsis/sleeper ids; `df.attrs['def_vs_pos']`) | ~509 × 17 rows/player |
130
130
  | `load_ppg_projections()` | Model-predicted PPG for established players | ~250 × 4 |
131
131
  | `load_adp_value_model()` | VOR vs ADP, hit probability, confidence interval | ~153 × 10 |
132
132
  | `load_volume_projections()` | Team pass/rush/target volumes with low/high bands | ~153 × ~14 |
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "stathead"
7
- version = "0.3.2"
7
+ version = "0.3.3"
8
8
  description = "Python client for the StatHead fantasy football model — rookie career predictions, historical ADP, and flattened feature matrices."
9
9
  readme = "README.md"
10
10
  license = { text = "MIT" }
@@ -42,7 +42,7 @@ from .prospects import load_prospect_grades
42
42
  from .sql import list_tables, query, register
43
43
  from .stats import load_player_stats
44
44
 
45
- __version__ = "0.3.2"
45
+ __version__ = "0.3.3"
46
46
 
47
47
  __all__ = [
48
48
  "__version__",
@@ -48,7 +48,9 @@ def load_redraft_projections() -> pd.DataFrame:
48
48
  def load_weekly_projections() -> pd.DataFrame:
49
49
  """Per-week 2026 projections — the season projection split across the
50
50
  schedule, one row per player per scheduled game (17 rows/player; byes
51
- omitted).
51
+ omitted). Covers QB/RB/WR/TE plus kickers (position ``K``, the current
52
+ depth-chart PK1 per team) and team defenses (position ``DST``, name
53
+ ``"<TEAM> DST"``, ``sleeper_id`` = team code).
52
54
 
53
55
  Weekly points = season PPG x opponent defense-vs-position multiplier
54
56
  (prior-season PPR allowed per game vs league average, heavily regressed)
@@ -57,9 +59,11 @@ def load_weekly_projections() -> pd.DataFrame:
57
59
  games (health) discount. Half/Std conversion: weekly receptions scale
58
60
  with the same multiplier, so ``rec_w = recPG * proj_ppr / ppg``.
59
61
 
60
- Columns: ``player_key``, ``name``, ``position``, ``team``, ``week``,
61
- ``opp``, ``home``, ``matchup_mult``, ``proj_ppr``, ``ppg``, ``recPG``,
62
- ``gp``, ``season``.
62
+ Columns: ``player_key``, ``name``, ``position``, ``team``, ``gsis_id``,
63
+ ``sleeper_id``, ``week``, ``opp``, ``home``, ``matchup_mult``,
64
+ ``proj_ppr``, ``ppg``, ``recPG``, ``gp``, ``season``. The gsis/sleeper
65
+ ids are stamped at build time from the player crosswalk (None for
66
+ pre-NFL rookies).
63
67
 
64
68
  Metadata on ``df.attrs``: ``meta`` (generatedAt + method note) and
65
69
  ``def_vs_pos`` (per-team defense-vs-position multiplier table).
@@ -82,6 +86,8 @@ def load_weekly_projections() -> pd.DataFrame:
82
86
  "name": p["name"],
83
87
  "position": p["pos"],
84
88
  "team": p["team"],
89
+ "gsis_id": p.get("gsis"),
90
+ "sleeper_id": p.get("sleeper"),
85
91
  "week": week,
86
92
  "opp": game["opp"],
87
93
  "home": game["home"],
@@ -143,6 +143,11 @@ def test_weekly_projections():
143
143
  sums = df.groupby("name").agg(total=("proj_ppr", "sum"), ppg=("ppg", "first"))
144
144
  assert ((sums["total"] - sums["ppg"] * 17).abs() < 1.0).all()
145
145
  assert isinstance(df.attrs.get("def_vs_pos"), dict)
146
+ # K + DST: one per team, 32 each.
147
+ assert (df[df["position"] == "K"]["team"].nunique()) == 32
148
+ dst = df[df["position"] == "DST"]
149
+ assert dst["team"].nunique() == 32
150
+ assert (dst["sleeper_id"] == dst["team"]).all()
146
151
 
147
152
 
148
153
  def test_ppg_and_adp_value_model():
File without changes
File without changes
File without changes
File without changes