## The Data Foundation
Your model is only as good as the data it is trained on. Data quality, completeness, and appropriate scope are the most important determinants of model quality — more important than model complexity.
## What Data You Need
For a football goals model:
**Match-level data:**
- Date, competition, home team, away team
- Full-time score
- Match xG (home and away) — per shot
- Match xGA (home and away conceded)
- Pre-match odds (opening and closing)
**Team-level data (derived from match data):**
- Rolling xG scored per match (5, 10, 15-match windows)
- Rolling xGA per match (5, 10, 15-match windows)
- Home and away splits
**Contextual data:**
- Days rest before match
- Match significance (cup, league, European)
- Stadium capacity / attendance (where available)
- Weather data (for outdoor stadiums)
## Free Data Sources
| Source | Coverage | Format |
|---|---|---|
| FBref | Top 5 EU leagues + major comps | Web scraping / CSV download |
| Understat | Premier League, Bundesliga, La Liga, Serie A, Ligue 1, RFPL | JSON via API |
| football-data.co.uk | 30+ leagues, historical back to 1990s | CSV download |
| The Odds Portal | Historical odds | Web scraping |
| OpenWeatherMap | Historical weather | API (free tier) |
## Data Management Best Practices
- Store data in a structured database (SQLite for solo projects, PostgreSQL for teams)
- Automate data collection with weekly scripts
- Maintain a data changelog — when data was collected, from what source, and any known gaps
- Never overwrite raw data — always maintain the original as collected
Create a free account to track your progress and save bookmarks.