Dugout Value
Baseball research on pitching, hitting, and projections, plus tools for comparing players, contracts, and trade value.
翻譯準備中
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證IPL analytics + ML Dream11 fantasy-points model (LightGBM, quantile ranges, exact XI optimiser) with a Model Lab. Next.js + FastAPI + Postgres.
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
IPL analytics and a machine-learning Dream11 fantasy-points model: 19 seasons of
ball-by-ball data (2008–2026), a LightGBM model that predicts every player's fantasy points
(with a floor–ceiling range) at the toss, an exact team optimiser, and a Model Lab that
explains how the model was trained and how good it really is.
Live: website https://predict11-olive.vercel.app · API https://predict11-api.onrender.com/docs
(free tier: the first request after ~15 idle minutes takes about a minute to wake the API)檢視完整 README ↗IPL analytics and a machine-learning Dream11 fantasy-points model: 19 seasons of ball-by-ball data (2008–2026), a LightGBM model that predicts every player's fantasy points (with a floor–ceiling range) at the toss, an exact team optimiser, and a Model Lab that explains how the model was trained and how good it really is.
Live: website https://predict11-olive.vercel.app · API https://predict11-api.onrender.com/docs
(free tier: the first request after ~15 idle minutes takes about a minute to wake the API)
| Area | What you get |
|---|---|
| Points table | Every season 2008–2026, official NRR / tie-breaks, playoff results, champion card, season leaders, points race, playoff scenarios and the season story |
| Teams | Franchise history, season-by-season finishes, squad (latest roster), matches, team v team |
| Players | Full profiles (batting, bowling, fielding, phase splits, pace v spin, v batting hand), fantasy range, form; Compare up to 3 players with split bars, skill radar and season charts |
| H2H | Batter v bowler face-off with sample-size confidence, dismissal types, by season |
| Venues | Stadium photos, par scores (2023+ impact-player era vs all-time), toss and chase trends, phase run rates, pace v spin, dew & weather |
| Fantasy | Dream11 points for every match since 2008 (validated 40/40 against published 2026 totals), leaderboards, consistency, hindsight best XIs, team of the season |
| Predictions | The model's XI for every 2026 match, made before the match from earlier data only, vs a last-5-form baseline and the best possible XI |
| Build | Pitch-view team builder on the model's predictions: lock / exclude, re-optimise under Dream11 rules |
| Model Lab | The whole training story for learning ML: data, 92 features, learning curves, tuning, evaluation with confidence intervals, calibration, residuals, SHAP explanations, run comparison and a glossary |
Predicts each player's Dream11 points at the toss (playing XIs, venue, toss and weather known; everything else from earlier matches only).
| vs last-5 baseline | 2025 test (frozen) | 2026 walk-forward (retrained) |
|---|---|---|
| Best-XI points / match | 759 vs 751 (n.s.) | 831 vs 755 (+76, CI +39…+115) |
| Captain in top 2 | 21% vs 17% (n.s.) | 27% vs 7% |
| MAE per player | 33.6 vs 35.9 | 35.5 vs 38.5 |
Fantasy points are mostly noise (the model explains ~5% of variance), so the edge comes from many small advantages and is largest when the model is retrained in-season. Full write-up: docs/MODEL-REPORT.md, and interactively in the Model Lab.
Cricsheet (2008–26) ─┐ ┌─► Next.js 16 web (Vercel)
stats.bcci.tv ───────┼─► ingest + player registry ─► Postgres (Supabase) ◄─┤
ESPN / Cricbuzz ─────┤ Dream11 scoring, weather, ▲ └─► FastAPI (Render)
Open-Meteo ──────────┘ photos, credits │ │
│ analytics, optimiser,
features ─► LightGBM (mean + quantiles) ┘ Model Lab, predictions
| Layer | Stack |
|---|---|
| Web | Next.js 16 (App Router), React, Tailwind v4, TanStack Query, Recharts, Vitest |
| API | Python 3.12+, FastAPI, SQLAlchemy, Pydantic, pandas, LightGBM, PuLP / HiGHS, uv |
| Data | PostgreSQL 16/17, Alembic migrations |
| Deploy | Vercel (web) · Render free, Docker (API) · Supabase free (Postgres) · GitHub Actions (CI, keep-alive) |
backend/ FastAPI app + data pipeline + model (src/p11/{api,analytics,ingest,registry,
scoring,fantasy,features,model,optimize}), Alembic migrations, tests
web/ Next.js app (src/app routes, src/features/*, shared src/components)
models/ trained model run deployed with the API (models/latest.json → run dir)
data/ raw inputs (squad CSVs with credits, curated photo lists); downloads are git-ignored
docs/ model report, plan, feature catalog, design direction, next queue
infra/ docker-compose for local Postgres, helper scripts
spikes/ early source-scraping experiments
Requirements: Docker, uv, Node 22+ and pnpm.
cp .env.example .env
make db-up # Postgres 16 on :5433
make setup # backend deps
make migrate # schema
make api # API on http://localhost:8000 (docs at /docs)
make web # web on http://localhost:3000 (cd web && pnpm install first)
make test # backend tests (integration tests need the loaded database)
Loading the data from scratch (uv run p11 --help lists everything):
cd backend
uv run p11 cricsheet download ... # Cricsheet zips
uv run p11 registry load # players, ids, aliases
uv run p11 backfill cricsheet ... # matches + ball-by-ball
uv run p11 fantasy compute # Dream11 points per player-match
uv run p11 credits load --season 2025 # squad CSVs → credits
uv run p11 attributes load # roles, batting hand, bowling type, photos
uv run p11 media cache --all # local photo cache
uv run p11 weather venues ... # coordinates + match weather
uv run p11 model train # ~25 min on 8 cores; writes models/<run>/ + DB rows
A snapshot of the database can be restored with make db-restore FILE=....
render.yaml blueprint → Docker image from backend/Dockerfile
(bundles the model run). Set P11_DATABASE_URL. Auto-deploys on push to main.web/, env NEXT_PUBLIC_API_URL = the API URL..github/workflows/keepalive.yml pings the API every 2 days (repo variable
API_URL) so the free database doesn't pause.models/<run>/ and Render redeploys.Ball-by-ball data from Cricsheet (ODC-BY). Player photos and team crests from the official IPL site; stadium photos from Wikimedia Commons under their CC licences (credited on each page). Weather from Open-Meteo. Not affiliated with the IPL, BCCI or Dream11; for analysis and learning only.
The previous (v1) version of this project is preserved at the v1 tag.