11 Commits

Author SHA1 Message Date
ramseshk 6d4bfcfa82 fix: calibrate auction prices to real market values
- Replaced raw QI (listing price) with calibrated formula:
  price = max(3, FVM × 0.4 + (FV_proj − 5.5) × 20)
- Martinez L.: 35 cr → 199 cr (user said no less than 200)
- Malen: 34 cr → 205 cr
- Thuram: 29 cr → 156 cr
- Elite tier (>100 cr): 10 players
- Solid starters (50-100 cr): 26 players
- Budget picks (<50 cr): 469 players
- Bid ceiling = market_value × 1.3
- Updated KPIs to show real price distribution
- Live at http://localhost:8518
2026-08-12 12:01:48 +08:00
ramseshk 000d4b02e8 feat: wire dev preview to real 26/27 Serie A data (505 players, 2021 votes)
- Load real projections, stats, roster, votes from data/ and mid_outputs/
- 161 FBref features merged per player (xg, passes, tackles, cards, etc.)
- All 12 models trained on real Serie A player pool
- Top projection: Malen (8.49), Martinez L. (8.06), Thuram (7.74)
- Rich player features: cards/90, fouls/90, xG, xA, progressive metrics
- Live Auction Simulator uses real QI/QA/FVM prices
- Dashboard live at http://localhost:8516
2026-08-12 11:51:42 +08:00
ramseshk 00dc7f2bcb feat: add dev preview dashboard showcasing all 12 new ML models
- New page 06_dev_preview.py: interactive ML model showcase
- All 12 models initialized from synthetic data with live charts
- Live Auction Simulator: bandit + opponent model + budget optimizer
- Tabbed UI: 6 tabs, one per phase
- Resilient warehouse: returns typed empty DataFrames when no data
- Dev Preview set as default landing page for demo mode
- Live at http://localhost:8507
2026-08-12 11:34:00 +08:00
ramseshk ee563a87d2 Fix KeyError: 'price' in auction _price_dist_chart — compute on the fly 2026-08-11 16:46:31 +08:00
ramseshk 27a3f3285c Fix GRIDLINE import error in auction page + add auction contingency plan
- Added missing GRIDLINE import to auction page template imports
- New contingency section: per-role backup targets if bids are missed
- Shows up to 12 backup players per role with FV, estimated price, games
- xG values note: synthetic from FBref data (real xG blocked by Cloudflare)
2026-08-11 16:32:12 +08:00
ramseshk 4ce76fe55e Season-long projections + 4-3-3 formation default
- 505 players projected across all 38 matchdays (opponent-adjusted, home/away, fatigue)
- Season FV rankings: Douvikas 254, Paz N. 254, Dimarco 251, Martinez L. 245
- 4-3-3 Best XI (league): 2851 FV total with captain Douvikas
- 4-3-3 from Al-Cihred squad: 2562 FV (90% efficiency)
- Dashboard Matchday page: season projection rankings table + 4-3-3 XI
- Dashboard Lineup page: default formation changed to 4-3-3
- Per-matchday granular projections saved
- All 49 tests passing
2026-08-11 16:27:01 +08:00
ramseshk 8e759b0d0f Project Al-Cihred: ML auction strategy with exact 500cr spend
- LightGBM trained on 11,300 per-matchday votes (R²=0.147, RMSE=1.19)
- MILP with exact 499-500cr budget: 3GK+8DEF+8MID+6FWD
- Practical constraints: 2 starting GKs, 21/25 reliable (>15g)
- Realistic prices: Lautaro 229cr, Malen 220cr, Douvikas 56cr
- Squad: Svilar(21)+Carnesecchi(18)+Christensen(1)=40GK · 8DEF 128cr · 8MID 152cr · 6FWD 180cr
- Every player has 2-3 alternatives
- Updated dashboard auction page to load the plan
2026-08-11 16:20:45 +08:00
ramseshk 6c1fb46e8a Fix auction: realistic valuations, multi-strategy comparison, role chips rendering
- Realistic price model: scales by FVM (Lautaro FVM=370 → ~199 cr, QI×5.7)
  Formula: qi * max(1.2, fvm/65) with forward premium and small-sample penalty
- 5 strategy engines: Balanced, Value, Stars, Safe, MILP-Lite
  Each with different score functions (value ratio, stability, risk adj)
- Strategy comparison radar grid: total FV, efficiency, stars, avg games, budget%
- Squad table with color-coded price bands (gold >100cr, sky >50cr, green <50cr)
- Market distribution histogram by role
- Top value picks section with cr/FV efficiency
- Fixed role_chip HTML rendering in all pages (unsafe_allow_html=True)
- Verified: 0 errors, 31 role chips, 5 KPIs, 8 charts
2026-08-11 16:13:38 +08:00
ramseshk 30d676517e Fix Players page KeyError + use_container_width deprecation
- Players page: fix regression_chart xg_col default (goals_p90 -> xg_p90)
- charts.py: make regression_chart defensive against missing columns
- All pages: replace use_container_width=True with width='stretch'
- Verified: all 5 pages render with zero errors via Playwright browser test
2026-08-11 15:24:39 +08:00
ramseshk 397078d635 Fix dashboard imports for Streamlit multi-page routing
- Add sys.path.insert at top of app.py and all 5 page files
- Fix .streamlit/config.toml CORS/XSRF conflict
- Remove duplicate st.set_page_config from page files
- Verified: all pages import cleanly, dashboard boots via streamlit run
- All 49 tests passing (31 original + 18 dashboard)
2026-08-11 15:08:09 +08:00
ramseshk 65f5b66b05 Dashboard: Stadium Night design system, 5-page Streamlit app, warehouse exporter
- src/export/warehouse.py: reads scattered pipeline artifacts → 6 Parquet files
  (players, fixtures, predictions, lineups, votes, model_metrics)
- dashboard/warehouse.py: read-only cached Parquet loader
- .streamlit/config.toml: dark theme base, server config
- dashboard/viz/template.py: Plotly 'fantabeto_dark' template (single source of truth)
  - Semantic palette: pitch_green #00D084, gold #FFC94D, red #FF4D5E, sky #38BDF8
  - Space Grotesk headers, Inter body, tabular numerals
  - All 10 chart colors banned from default palette
- dashboard/viz/components.py: KPI cards, role chips, section headers, CSS injection
- dashboard/viz/charts.py: 10 pure chart functions (df → Figure)
  - percentile radar, fixture heatmap, regression comparison, bonus donut
  - card risk gauge, budget waterfall, value scatter, error violins
- dashboard/viz/pitch.py: SVG pitch component — dark turf gradient,
  player badges sized by FV, gold captain ring, bench strip, formation label
- 5 pages:
  - 01_matchday: KPI sparklines, fixture heatmap, start/sit grid, bump chart
  - 02_players: search, radar, regression, bonus/malus, card risk, news feed
  - 03_auction: budget slider, waterfall, value scatter, grid auction heatmap
  - 04_lineup: SVG pitch, what-if toggles, opponent mirror, MCTS captain
  - 05_lab: error violins, feature importance, calibration curve, backtest
- dashboard/app.py: multi-page Streamlit entry with sidebar navigation
- dashboard/tests/test_dashboard.py: 18 unit tests (warehouse, template, charts, pitch)
- DASHBOARD.md: full architecture docs, design system reference
- 49 total tests passing (31 existing + 18 dashboard)
2026-08-11 14:53:51 +08:00