Skip to content
supevilPublic

About

AI足球

Resources

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

⚽🏀🎾 Ruslan Magana Sports Intelligence

Tomorrow's Biggest Games — predicted by AI, refreshed every day.

AI match predictions · live results · trending games — updated every 30 minutes.

Daily Pipeline Live Refresh Live Site HF Dataset HF Models License: MIT

Last updated: 2026-10-30 10:12 UTC — refreshed automatically every day.


🗓️ Always in season

The portal is season-aware year-round: when the World Cup ends it rolls to the club season, tennis Slams, NBA, IPL, and back to qualifiers — automatically, from a built-in tournament calendar. Updated daily.

🔥 Featured right now: ⭐ UEFA Champions League (football)

In season today:

⭐ UEFA Champions League · 🏴 Premier League · 🏀 NBA · 🇪🇸 La Liga · 🇮🇹 Serie A · 🇩🇪 Bundesliga · 🇫🇷 Ligue 1 · 🏀 EuroLeague


🔮 Tomorrow's Top 5 AI Predictions

Auto-generated every day by the prediction pipeline from freshly trained, sport-optimized models.

# Match League Kickoff AI Pick Confidence
1 ⚽ Real Madrid vs Man City UEFA Champions League 21:00 Real Madrid favoured ██████░░░░ 56%
2 🏀 Lakers vs Celtics NBA Finals 08:30 Lakers favoured █████░░░░░ 48%
3 🎾 Jannik Sinner vs Carlos Alcaraz Wimbledon Men's SF 15:00 Jannik Sinner favoured ████░░░░░░ 44%
4 🏏 India vs Australia ICC Test Championship 10:00 India favoured ████░░░░░░ 41%
5 ⚽ PSG vs Bayern Munich UEFA Champions League 21:00 PSG favoured ████░░░░░░ 39%

🏆 FIFA World Cup 2026 — Knockout Predictions

International matches get a dedicated model: 90-minute result plus a to-advance layer (extra time / penalties), group standings, and qualifier odds. Free data via OpenFootball, upgraded to live when an API key is set.

Tie Stage 90' result To advance
⚽ Spain vs Croatia Round Of 32 Spain 49% · draw 21% · Croatia 30% Spain 65% · Croatia 35%
⚽ Argentina vs Norway Round Of 32 Argentina 62% · draw 15% · Norway 23% Argentina 78% · Norway 22%
⚽ France vs Senegal Round Of 32 France 58% · draw 17% · Senegal 25% France 74% · Senegal 26%

🧠 Sport-Optimized Models

Every sport has different dynamics, so each game type gets its own model — retrained daily and published to the 🤗 model registry under <sport>/latest/.

Sport Model Algorithm Task Latest accuracy
⚽ Football football-hgb hist_gradient_boosting multiclass: home / draw / away 1.000
🏀 Basketball basketball-logreg logistic_regression binary: home / away win 1.000
🎾 Tennis tennis-gbdt gradient_boosting binary: player 1 / player 2 win 1.000
🏏 Cricket cricket-rf random_forest binary: home / away win 1.000

All probabilities are calibrated (isotonic / sigmoid) so the published win chances are trustworthy. Predictions are informational only — not betting advice.


✨ What it does

  • 🗓️ Tomorrow's biggest games, ranked by global interest, league importance, social velocity, and model confidence.
  • 📡 Live results for football, basketball, tennis, cricket, baseball & esports — refreshed every 30 minutes.
  • 🔥 Trending matches worldwide with audience and momentum.
  • 🤖 Daily-retrained ML models, one per sport, with explainable win probabilities.
  • 🎨 Premium dashboard that matches the RuslanMV design language — served as static JSON for instant loads.

🏗️ Architecture

flowchart LR
  A[Sports APIs<br/>+ mock fallback] --> B[Normalize<br/>canonical schema]
  B --> C[(🤗 Dataset<br/>raw → bronze → silver → gold)]
  C --> D[Features<br/>Elo · form · H2H · rest]
  D --> E[Train sport-optimized models<br/>daily]
  E --> F[(🤗 Models<br/>per-sport · latest)]
  F --> G[Predict tomorrow<br/>+ explanations]
  C --> G
  G --> H[Small public JSON<br/>assets/data/sports/*.json]
  H --> I[/sports-trends/ dashboard<br/>+ dynamic README/]
Loading

GitHub keeps only code, workflows, the UI, and small JSON. All large data and model artifacts live in Hugging Face.

🔁 Three cadences

Cadence What runs Output
Every 30 min fetch live → normalize → publish live/today/status.json, raw partitions to HF
Every day refresh dataset → features → train + publish models → predict tomorrow → update README tomorrow/predictions/trending.json, models.json, fresh HF models
Weekly deep retrain over full history benchmarked models to HF

💡 The daily cadence guarantees there is always a freshly trained model and an up-to-date prediction set — the Top-5 table above is rewritten on every run.

🚀 Quick start

make install   # Python deps + Ruby/Jekyll gems
make serve     # generate JSON, then serve the dashboard
               # → http://127.0.0.1:4000/sports-trends/

No Ruby? make preview runs a zero-dependency Python server. Everything works offline with realistic mock data — no API keys or tokens required.

# Run the daily pipeline locally (dry-run, no Hugging Face writes):
export PYTHONPATH=src
python scripts/run_build_training_dataset.py --dry-run
python scripts/run_train_models.py --dry-run        # trains the sport-optimized models
python scripts/run_predict_tomorrow.py              # writes tomorrow.json + predictions.json
python scripts/update_readme.py                     # refreshes this README's dynamic blocks

🤗 Hugging Face integration

With HF_TOKEN set, the same scripts upload for real:

Without a token, every script runs in dry-run against local .data_lake/ and .models/ (both gitignored).

Enable the live daily pipeline by adding the HF_TOKEN Actions secret:

export HF_TOKEN=hf_xxxxxxxx
./scripts/setup_github_secrets.sh ruslanmv/sports-trends

or via Settings → Secrets and variables → Actions → New repository secret (name HF_TOKEN).

📡 Free data sources (year-round, verified reachable)

Source Key? Covers Status
OpenFootball none Soccer leagues + World Cup (many seasons) ✅ HTTP 200, public domain
TheSportsDB none (free key) Multi-sport upcoming + finished results ✅ reachable, keyless
TheStatsAPI none (attribution) World Cup 2026 fixtures + kickoff times ✅ reachable, keyless
football-data.org free token Top leagues + WC fixtures/tables 🔑 reachable (403 w/o token)
API-Football free key (100/day) Best live incl. World Cup 🔑 reachable (403 w/o key)

The provider stack tries the richest available source and always falls back to the next, ending at bundled mock data — so the portal works with or without keys. In production only the publishing steps set SPORTS_ENABLE_LIVE_FEED=1, so the public dashboard is built from the real keyless feeds (TheSportsDB for leagues, OpenFootball + TheStatsAPI for the World Cup); deterministic mock data is the safety net for offline/CI, empty responses, and free-tier rate limits. Tests force SPORTS_DISABLE_NETWORK=1 so CI never consumes third-party quota. A built-in tournament calendar (features/sports_calendar.py) keeps the featured competition correct all year: World Cup → club leagues → tennis Slams → NBA → IPL → qualifiers, automatically. The models learn continuously via a prediction feedback loop (log → reconcile → retrain).

Free-tier API key policy

The project should prefer free, public, or keyless sources. For TheSportsDB, keep THESPORTSDB_KEY unset to use the public free/test key, or create a free account at TheSportsDB and copy the key from your user profile if you need your own free key. If TheSportsDB returns HTTP 429, do not fail the build and do not add a paid-only dependency: reduce live-feed calls, let the provider fall back to bundled mock data, and keep tests network-disabled.

🗂️ Project layout

sports/                 Jekyll pages (index, per-sport, match/league SEO pages)
_layouts/ _includes/    Dashboard layout + components
assets/css|js           Premium UI (JSON-driven, graceful fallback)
assets/data/sports/     Small public JSON the site + README consume
src/sports_trends/      providers · ingestion · features · datasets · models · inference · seo · social
scripts/                Pipeline entry points (one per stage)
.github/workflows/      11 automated workflows (30-min / daily / weekly)
docs/                   Architecture, ML pipeline, data schema, SEO, legal

🧪 Quality

  • ✅ Leakage-safe features (a test plants a future blowout and proves it's ignored).
  • ✅ JSON Schema validation on every public file.
  • ✅ 30+ unit tests across providers, normalization, features, training, inference, SEO.
  • 📚 Full docs in docs/ — see ML_PIPELINE.md and HF_DATASET_ARCHITECTURE.md.

🚀 Deploy to production

Served entirely from this repo via GitHub Pages at https://ruslanmv.com/sports-trends/ (no commits ever go into ruslanmv.github.io). The site is baseurl-aware (baseurl: /sports-trends) and the dashboard is the project root, so nothing 404s.

One-time: push to main, then Settings → Pages → Source = GitHub Actions. The Sports Deploy (GitHub Pages) workflow builds + publishes it. The data pipeline is already live via Actions + HF_TOKEN. Full guide: docs/DEPLOYMENT.md.

⚖️ Disclaimer

Predictions are generated for informational and entertainment purposes only. They are not betting, gambling, or financial advice, and are not guarantees of any outcome. See docs/LEGAL_DISCLAIMER.md.

Built by Ruslan Magana Vsevolodovna · powered by Hugging Face 🤗 + GitHub Actions ⚙️

About

AI足球

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages