Skip to content

Add household-weighted view; hide bootstrap intervals behind a toggle#12

Merged
MaxGhenis merged 1 commit into
mainfrom
feat/household-weighted-view
May 9, 2026
Merged

Add household-weighted view; hide bootstrap intervals behind a toggle#12
MaxGhenis merged 1 commit into
mainfrom
feat/household-weighted-view

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

Two leaderboard tweaks following live-site review:

1. Household-weighted view

  • New sensitivity option that ranks models by the canonical household_equal_impact_scores statistic (each household contributes equally; outputs within a household are weighted by absolute reference dollar share with a 0.3 floor). This is the same statistic the paper's @tbl-impact-floor is built on.
  • policybench/analysis.py:build_dashboard_payload reads analysis['impact_summary'] and writes impactScore (per country) and impactCountryScores (in the global view) into modelStats. app/src/data.json regenerated from the committed paper/snapshot/20260501/{us,uk}_impact_summary_by_model.csv. Manifest dashboard sha256 refreshed.
  • Site reads modelStats[].impactScore directly when the household-weighted view is active — no client-side recomputation needed.

2. Bootstrap intervals hidden by default

  • The Rank N · 95% L–U line was a lot of noise for casual visitors. The leaderboard now hides intervals by default and exposes a Show 95% intervals checkbox in the controls row.
  • When the toggle is off, the bootstrap computation is skipped entirely, so first paint no longer pays the 400-draw cost on mobile.
  • Intervals stay hidden under the Household-weighted view (no bootstrap path for that estimator yet).

Verification

  • uv run pytest -q clean (190 passed)
  • bunx eslint . --max-warnings=0 clean
  • bun run build clean
  • SSR HTML on / contains all six sensitivity views, the Show 95% intervals toggle, and no Rank/95% interval strings; Binary only is disabled on Global as before.

🤖 Generated with Claude Code

Sensitivity selector
- New "Household-weighted" view ranks models by the canonical
  household_equal_impact_scores statistic (each household contributes
  equally, output groups within a household are weighted by absolute
  reference dollar share with a 0.3 floor — the same statistic the
  paper's @tbl-impact-floor reports). Reads precomputed impactScore
  from modelStats so no client-side recomputation runs.
- analysis.build_dashboard_payload now reads analysis['impact_summary']
  and writes impactScore (and impactCountryScores in the global view)
  into modelStats.
- app/src/data.json refreshed with the new fields from the committed
  paper/snapshot/20260501/{us,uk}_impact_summary_by_model.csv. Manifest
  dashboard sha256 refreshed.

Bootstrap intervals
- Hidden by default. New "Show 95% intervals" checkbox in the controls
  row toggles them on; the bootstrap computation is skipped entirely
  when off, so first paint no longer pays the 400-draw cost on mobile.
- Intervals stay hidden under the Household-weighted view (no bootstrap
  path implemented for that estimator yet).

Verification
- bunx eslint . --max-warnings=0 clean.
- bun run build clean.
- uv run pytest -q clean (190 passed).
- SSR HTML on / contains all six sensitivity views, the Show 95%
  intervals toggle, and no Rank/95% strings; Binary only is disabled
  on Global as before.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policybench-site Error Error May 9, 2026 1:17am

Request Review

@MaxGhenis MaxGhenis merged commit 2ff9bf0 into main May 9, 2026
3 of 4 checks passed
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 this pull request may close these issues.

1 participant