πŸ—ΊοΈ Amfor-Cast β€” Unified Product Roadmap

The master plan: architecture, features, and milestones β€’ Aug 2026

1. Vision

Amfor-Cast is a self-learning weather intelligence platform that gets smarter with every user interaction. It compares 8 forecast models, learns which one to trust for each location, and provides route-aware weather planning with adaptive model selection.

2. Target Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ GitLab (code + CI) β”‚ β”‚ β€’ Source of truth β”‚ β”‚ β€’ CI: lint, test β”‚ β”‚ β€’ Dev preview: GitLab Pages β”‚ β”‚ β€’ Tag β†’ triggers release β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ git pull (Pi, every 15min) β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Raspberry Pi 5 (4GB) β€” home network β”‚ β”‚ β”‚ β”‚ /opt/amfor-cast/ β”‚ β”‚ β”œβ”€β”€ repo/ (auto-pulled from GitLab main) β”‚ β”‚ β”œβ”€β”€ config.ini (DB creds, paths β€” not in git) β”‚ β”‚ β”œβ”€β”€ data/ (JSON fallback + route-logs) β”‚ β”‚ β”œβ”€β”€ output/ (generated data HTML β†’ auto-synced hourly) β”‚ β”‚ β”œβ”€β”€ platform/ (site structure β†’ synced via release.py) β”‚ β”‚ β”œβ”€β”€ backup/ (timestamped platform promote snapshots) β”‚ β”‚ β”œβ”€β”€ venv/ (Python 3.13 + pymysql + markdown) β”‚ β”‚ └── cron.log (all cron output) β”‚ β”‚ β”‚ β”‚ Services: β”‚ β”‚ β€’ Cron: hourly forecast + daily validator β”‚ β”‚ β€’ release.py: deploy-test / promote / rollback β”‚ β”‚ β€’ rsync: output β†’ tarhely.com (prod + nonprod) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ rsync (SSH) β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ tarhely.com (cPanel hosting) β”‚ β”‚ β”‚ β”‚ amfor-cast.com (production β€” public audience) β”‚ β”‚ β”œβ”€β”€ index.html, forecasts, history, rankings β”‚ β”‚ β”œβ”€β”€ route-weather.html + .js β”‚ β”‚ └── model-rankings.json β”‚ β”‚ β”‚ β”‚ nonprod.amfor-cast.com (staging β€” testing) β”‚ β”‚ β”œβ”€β”€ same structure, unreleased features β”‚ β”‚ └── may break, used for validation before promote β”‚ β”‚ β”‚ β”‚ MySQL: amforcas_forecasts β”‚ β”‚ β”œβ”€β”€ forecasts + forecast_hours (daily snapshots) β”‚ β”‚ β”œβ”€β”€ evaluations (forecast vs actuals) β”‚ β”‚ └── rankings (computed model rankings) β”‚ β”‚ β”‚ β”‚ Pure static serving + DB. All compute on Pi. β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

3. Release Flow (TUI)

# On the Pi via SSH:
$ ./release.py status
  Output dir:  /opt/amfor-cast/output
               22 HTML files, last updated: 2026-08-11 13:05:00
  Backup:      /opt/amfor-cast/backup
               22 HTML files, snapshot: 2026-08-11 07:05:00
  Prod:        amfor-cast:/home/amforcas/public_html/
  Nonprod:     amfor-cast:/home/amforcas/nonprod.amfor-cast.com/

$ ./release.py deploy-test
  β”œβ”€ git pull βœ“
  β”œβ”€ generating reports...
  (run-and-publish.py output)
  β”œβ”€ rsync β†’ nonprod.amfor-cast.com βœ“
  βœ“ Deployed to nonprod! Verify at: https://nonprod.amfor-cast.com

$ ./release.py promote
  Source: /opt/amfor-cast/output (22 HTML files)
  Target: amfor-cast:/home/amforcas/public_html/
  ? Promote this content to PRODUCTION? [y/N] y
  β”œβ”€ backing up current production βœ“ (20260811_130500)
  β”œβ”€ rsync β†’ amfor-cast.com βœ“
  βœ“ Production updated! Live at: https://amfor-cast.com

$ ./release.py rollback
  Available backups:
    1. 20260811_130500 (22 files) ← latest
    2. 20260811_070100 (22 files)
  ? Rollback PRODUCTION to this backup? [y/N] y
  β”œβ”€ restoring backup β†’ output dir βœ“
  β”œβ”€ rsync β†’ amfor-cast.com βœ“
  βœ“ Production rolled back to 20260811_070100!

4. MySQL Database (tarhely.com)

Database: amforcas_forecasts on tarhely.com MariaDB. Credentials in config.ini (not in git).

JSON dual-write active until 2026-08-18, then JSON removed.

-- Core tables (implemented)
stations         -- fixed + route-discovered locations
forecasts        -- daily model snapshot headers (date, city, model)
forecast_hours   -- hourly data points per forecast (~384 per model)
evaluations      -- forecast vs actual MAE scores
rankings         -- computed model rankings per city/param/horizon

-- Route feedback (implemented)
route_logs       -- route requests with all-model forecasts

-- Future tables
headache_events  -- replaces headaches.txt (date, severity, city, notes)
users            -- user accounts (v1.2)
user_cities      -- saved favorite cities per user
user_routes      -- saved routes per user

5. Feature Roadmap

MVP (v1.0) β€” Foundation

Get the new architecture running with all existing features.

FeatureDetails
RPi setup + cronβœ… Done β€” Pi runs hourly, syncs to tarhely.com
Config parserβœ… Done β€” config.ini + shared/config_loader.py
SQLite migrationβœ… Done β€” MySQL on tarhely.com, shared/db.py, scripts wired
rsync deploy pipelineβœ… Done β€” Pi β†’ tarhely.com via SSH key
Existing features preservedβœ… All working on new infra
Unified design systemβœ… Done β€” All pages use shared base styles, CSS vars, centered logo, consistent header
Two environmentsβœ… Done β€” nonprod.amfor-cast.com + amfor-cast.com, --nonprod flag in run-and-publish.py
Release TUIβœ… Done β€” release.py: deploy-test, promote, rollback, status
API rate limitingβœ… Done β€” Flask + Flask-Limiter, 10 req/min on /api/log-route, systemd service
Cloudflare Tunnel❌ Dropped β€” using Tailscale for admin + PHP proxy on tarhely.com for public API

v1.1 β€” Route Planner Pro

Make the route planner production-grade.

FeatureDetails
Multi-route comparisonCompare 2-3 alternative routes side by side (see section 7)
Optimal departure timeTry multiple departure times, find driest/calmest window
Road condition warningsIce risk (dew point near temp + temp < 3Β°C), fog risk, visibility
Weather alerts on routeRain zones highlighted, strong wind segments, storm warnings
Mobile-first responsiveRoute planner optimized for phone screens
Self-learning from routesFeedback loop fully operational (Pi API receives + evaluates)

v1.2 β€” User Accounts

Personalization and saved preferences.

FeatureDetails
User registration/loginSimple email+password (see section 6 for auth approach)
Saved favorite citiesUser picks cities β†’ personal dashboard shows their forecasts
Saved routes"My commute" β€” one-click re-run with current departure time
Personal headache logLog events via UI instead of editing a text file
Personal risk alertsDashboard highlights when saved cities have high risk

v2.0 β€” Intelligence

FeatureDetails
Push notificationsEmail or browser push when high risk detected on saved cities/routes
Historical route replay"What was the weather last time I drove this?"
Seasonal model adaptationRankings adjust by month β€” winter models vs summer models
AMFOR forecast modelOwn ML-based forecast that blends NWP models β€” see section 14

Future β€” Nice to have

FeatureDetails
PWA / offline modeCache last forecast for offline viewing
Native mobile app (Android + iOS)See section 13 β€” dedicated mobile app plan
Widget / embedEmbeddable forecast widget for other sites
Multi-language expansionBeyond EN/HU β€” DE, SK, RO for neighbors

6. User Management β€” Auth Approach

Decision needed: Roll your own auth or use a service?

ApproachProsCons
Flask + bcrypt (DIY) Full control, no external dependency, free, works offline, educational Security risk if done wrong (CSRF, session fixation, password storage). You maintain it forever.
Auth0 (free tier) Battle-tested security, social login (Google), MFA, 7,000 users free External dependency, vendor lock-in, requires internet, JS SDK adds weight
Supabase Auth (free tier) Postgres-backed, self-hostable if needed, good JS client, 50k MAU free Another service to depend on, overkill for simple login
HTTP Basic Auth + Pi Dead simple, built into every browser, no JS needed Ugly UX, can't "log out" easily, no registration flow

My recommendation: Flask + bcrypt for MVP.

7. Multi-Route Comparison β€” Client vs Server

Decision needed: Where does the computation happen?

ApproachProsCons
Client-side (JS) No server load, works without API, instant for user, simpler backend Slower on mobile (8 models Γ— 2 routes Γ— 10 waypoints = 160 API calls), may hit Open-Meteo rate limits, burns user's data
Server-side (Pi) Fast (Pi has good internet), can cache/batch API calls, rate limit controlled, saves user bandwidth Pi must be reachable, adds API endpoint complexity, latency depends on tunnel speed
Hybrid Client fetches routes (OSRM), Pi fetches weather in batch. Best of both. Most complex to implement, two-step flow

My recommendation: Hybrid approach.

Why hybrid wins: 2 routes Γ— 8 models Γ— 10 waypoints = 160 Open-Meteo calls. Client-side this takes 30+ seconds on mobile. Pi does it in 5 seconds with batch requests. Also: Pi can cache repeated coords (same highway segment requested by multiple users = one API call).

8. Data Retention Policy

Data typeRetentionReason
Forecast snapshots (raw)90 daysOnly needed for scoring. After 90d, only aggregated scores matter.
Scores (per evaluation)1 yearSeasonal patterns need a full year to emerge.
Model rankings (aggregated)Forever (tiny)~1KB per recalculation, historical rankings show trends.
Route logs (raw)90 daysAfter evaluation, only the scores matter.
Actuals (measured weather)2 yearsUseful for headache analysis, climate trends.
User dataUntil account deletedGDPR-friendly: user can export + delete.
Headache eventsForeverMedical diary β€” never auto-delete.
# Weekly cleanup cron on Pi:
0 3 * * 0 sqlite3 /opt/amfor-cast/data/amfor-cast.db "
  DELETE FROM forecasts WHERE issued_date < date('now', '-90 days');
  DELETE FROM route_waypoints WHERE created_at < date('now', '-90 days');
  VACUUM;
"

9. Backup Strategy

WhatWhereFrequencyHow
SQLite DBGitLab (private repo) or Backblaze B2Dailysqlite3 .backup β†’ compress β†’ upload
Config + secretsEncrypted file on GitLabOn changeManual commit (age-encrypted)
Full Pi SD imageExternal driveMonthlydd image of SD card
# Daily DB backup cron:
0 4 * * * cd /opt/amfor-cast && \
  sqlite3 data/amfor-cast.db ".backup /tmp/amfor-backup.db" && \
  gzip -f /tmp/amfor-backup.db && \
  rclone copy /tmp/amfor-backup.db.gz remote:amfor-backups/$(date +%Y-%m-%d).db.gz && \
  find /tmp/amfor-backup* -delete

Recovery time: If Pi SSD dies, you can be back online in ~1 hour: flash new SD, install packages, clone repo, restore DB from backup, done.

10. Milestone Timeline (Estimated)

MilestoneDurationStatus
MVP Pi + MySQL + dual env + deployment3-4 sessionsβœ… Complete
v1.2 User management + saved cities2-3 sessionsβœ… Complete (auth, cities, admin panel)
v1.1 Route planner pro + mobile2-3 sessionsπŸ”² Next (multi-route, departure time, road conditions)
v2.0 AMFOR model + notifications3-4 sessionsπŸ”² Oct 2026+ (needs 60+ days of data)

11. What's Already Done

Current state of the project β€” everything carries forward into the new architecture:

12. Open Decisions

Decisions to make before starting MVP:

  1. Pi model: Pi 4 (4GB) or Pi 5 (4GB)? Already owned?
  2. Domain: Do you have one? (needed for subdomains + Cloudflare Tunnel)
  3. tarhely.com subdomains: Can you set up app.X and test.X?
  4. Home internet: Static IP or dynamic? ISP behind CG-NAT?
  5. Auth approach: Flask+bcrypt (recommendation) or external service?
  6. Multi-route: Hybrid (recommendation) confirmed?

13. Mobile App (Far Future)

Timing: After v2.0 is stable and PWA is proven. The PWA (v2.0) is the stepping stone β€” if it covers 90% of mobile use cases, a native app may not be needed at all.

Approach Options

ApproachEffortResultBest for
PWA (Progressive Web App) Low β€” you already have the web app Installable from browser, works offline, push notifications, home screen icon If 90% of native UX is enough. No App Store needed.
React Native / Expo Medium β€” single JS codebase for both platforms True native feel, App Store listing, background location access If you want App Store presence and native maps/GPS integration
Flutter Medium β€” Dart, single codebase Very smooth UI, both platforms from one code, hot reload If you want best-in-class UI polish, willing to learn Dart
Kotlin (Android) + Swift (iOS) High β€” two separate codebases Best performance, full platform access, ultimate native feel Only if you have a team or want to specialize per platform

Recommended path:

  1. First: PWA (v2.0) β€” add manifest.json, service worker, offline cache. Zero extra cost, installable immediately.
  2. Evaluate: Does PWA cover your needs? Push notifications, offline, home screen icon all work.
  3. If native needed: React Native + Expo β€” because you already know JavaScript, your API is already built, and Expo handles both stores.

What a Native App Adds Over PWA

FeaturePWANative app
Install from browserβœ…βŒ (App Store only)
Offline forecast cacheβœ…βœ…
Push notificationsβœ… (Android), ⚠️ (iOS limited)βœ… Full
Background GPS trackingβŒβœ… (auto-detect route start)
Widget on home screenβŒβœ… (show current forecast glanceable)
Haptic feedbackβŒβœ…
App Store discoverabilityβŒβœ…
Apple Watch / Wear OSβŒβœ… (departure time on wrist)
Siri/Google AssistantβŒβœ… ("Hey Siri, what's my commute weather?")

Mobile App Features (Wishlist)

Architecture with Mobile App

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Mobile App β”‚ β”‚ Web App (PWA) β”‚ β”‚ (React Native) β”‚ β”‚ (existing HTML/JS) β”‚ β”‚ β”‚ β”‚ β”‚ β”‚ β€’ Native maps β”‚ β”‚ β€’ Leaflet maps β”‚ β”‚ β€’ Background GPS β”‚ β”‚ β€’ Full dashboard β”‚ β”‚ β€’ Push via FCM/APNs β”‚ β”‚ β€’ Route planner β”‚ β”‚ β€’ Home widget β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”‚ Same API (Pi backend) β”‚ β–Ό β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Raspberry Pi β€” /api/ β”‚ β”‚ β”‚ β”‚ GET /api/forecast/:city β”‚ β”‚ GET /api/rankings β”‚ β”‚ POST /api/route-weather (coords + departure) β”‚ β”‚ POST /api/log-route (feedback) β”‚ β”‚ POST /api/auth/login β”‚ β”‚ GET /api/user/cities β”‚ β”‚ POST /api/headache (log event) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key insight: Building the Pi API properly for the web app (v1.1-v1.2) means the mobile app is just a different UI on top of the same backend. No new server work needed β€” only a new client.

App Store Requirements

PlatformCostRequirement
Google Play$25 one-timeGoogle Developer account, signed APK/AAB
Apple App Store$99/yearApple Developer account, Mac needed for final build
Alternative (Android)FreeDirect APK download from your website (sideload)

Cost-saving tip: Start Android-only (€25 one-time), distribute as direct APK from your website. Add iOS + App Store only if there's real demand. Expo/EAS can build iOS without owning a Mac ($99/year for Apple account still needed).

14. AMFOR Forecast Model β€” Own ML-Based Predictions

Vision: Build a custom machine-learning forecast model ("AMFOR") that learns from all NWP models' systematic errors and produces forecasts that outperform any individual input model for Hungarian locations. This is NOT a numerical weather model β€” it's a statistical post-processing system that corrects and blends existing NWP forecasts using local verification data.

14.1 Why This Works

The key insight: every day, today's forecasts become tomorrow's training data. A forecast made on Aug 10 for Aug 12 becomes a labeled example once Aug 12's actual measurements arrive. The database already collects exactly this data β€” forecasts vs actuals for 8 models Γ— 9 cities Γ— 16 horizons.

Instead of just picking the historically best model (current approach), we can learn a function that maps all models' predictions + context β†’ corrected forecast. This captures:

14.2 Architecture

NWP forecasts (Open-Meteo API) ECMWF / ICON / GFS / AROME / CMA / JMA / GEM β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Forecast DB β”‚ ← already built β”‚ (MySQL) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ Observed weather ──── (Archive API) β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Verification β”‚ ← already built β”‚ Engine β”‚ (evaluate.py) β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Feature Builder β”‚ ← NEW β”‚ β”‚ β”‚ β€’ All model β”‚ β”‚ predictions β”‚ β”‚ β€’ Recent biases β”‚ β”‚ β€’ Model spread β”‚ β”‚ β€’ Time/season β”‚ β”‚ β€’ Location β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β–Ό β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ AMFOR MODEL β”‚ ← NEW β”‚ (LightGBM) β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β” β–Ό β–Ό Corrected forecast Uncertainty β”‚ estimate β–Ό AMFOR-CAST (competes alongside other models in rankings)

14.3 Implementation Phases

PhaseWhatWhenComplexity
Phase 1 Weighted Ensemble β€” inverse-MAE weights per model/city/horizon Now (data exists) ~50 lines Python, no ML library needed
Phase 2 Feature Engineering β€” build training dataset from historical forecasts + actuals Sep 2026 (60+ days of data) SQL query + pandas DataFrame builder
Phase 3 LightGBM Training β€” train model on PC/Colab, deploy ~1MB model file to Pi Oct 2026 (90+ days) LightGBM/XGBoost, standard ML workflow
Phase 4 Live Inference β€” AMFOR appears as a model in forecast pages, competes in rankings Oct-Nov 2026 Inference script + integration with render pipeline

14.4 Phase 1 β€” Weighted Ensemble (No ML)

Can ship immediately. Uses existing evaluation data. No external libraries needed.

Instead of "pick the single best model", compute a weighted average:

# For each city/horizon/parameter:
weight_i = (1 / MAE_i) / sum(1 / MAE_j for all models j)

# AMFOR forecast:
amfor_temp = sum(weight_i * model_i_forecast for all models)

Weights recompute daily from the rolling 30-day evaluation window (same data that drives current rankings). The system already has everything needed β€” it's purely a new output step.

Expected improvement: 5-15% MAE reduction over best-single-model, because even the #2/#3 models contribute useful signal that pure selection throws away.

14.5 Phase 2 β€” Feature Engineering

Build a training dataset where each row is one forecast event that has been verified:

FeatureSourceType
ECMWF temperature forecastforecast_hours tablefloat
ICON temperature forecastforecast_hours tablefloat
GFS temperature forecastforecast_hours tablefloat
AROME temperature forecastforecast_hours tablefloat
CMA / JMA / GEM forecastsforecast_hours tablefloat
Model spread (max - min)computedfloat
Model agreement (std dev)computedfloat
Cloud cover (all models)forecast_hours tablefloat
Wind speed (all models)forecast_hours tablefloat
Surface pressure (all models)forecast_hours tablefloat
Recent ECMWF bias (7-day rolling MAE)evaluations tablefloat
Recent ICON biasevaluations tablefloat
Recent GFS biasevaluations tablefloat
Forecast horizon (hours)computedint
Hour of day (target time)computedint (0-23)
Day of yearcomputedint (1-366)
Latitude / Longitudecities tablefloat
TARGET: observed temperature (from Archive API verification)

Same structure repeats for precipitation (classification: rain/no-rain) and pressure.

14.6 Phase 3 β€” Model Training

Key decisions:

# Training pseudocode (runs on PC, not Pi)
import lightgbm as lgb
import pandas as pd

# Build features from DB
df = build_training_dataset()  # SQL β†’ pandas

X = df.drop(columns=["observed_temp"])
y = df["observed_temp"]

# Time-based train/test split
train = df[df["date"] < "2026-10-15"]
test  = df[df["date"] >= "2026-10-15"]

model = lgb.LGBMRegressor(
    n_estimators=500,
    learning_rate=0.05,
    num_leaves=31,
    min_child_samples=20,
)
model.fit(X_train, y_train)
model.booster_.save_model("amfor_temp_model.txt")

# β†’ scp amfor_temp_model.txt pi:/opt/amfor-cast/models/

14.7 Phase 4 β€” Live Inference on Pi

After save-forecast.py saves the NWP forecasts to DB, a new script runs inference:

# amfor-predict.py (runs on Pi, microseconds per prediction)
import lightgbm as lgb

model = lgb.Booster(model_file="/opt/amfor-cast/models/amfor_temp_model.txt")
features = build_features_for_today(city, horizon)
amfor_forecast = model.predict([features])[0]

# Save as another "model" in the forecast DB
insert_forecast(snapshot_time, today, city, "AMFOR", amfor_data)

The AMFOR forecast then appears in:

14.8 What We Are NOT Building

This is NOT a numerical weather prediction model. We are not:

We are building a statistical post-processing system (MOS-like) that learns local corrections on top of existing NWP output. This is exactly what national meteorological services do, and it works remarkably well.

14.9 Data Growth Projection

TimeframeData collectedTraining rows (approx)Capability
Aug 2026 (now)7 days Γ— 9 cities Γ— 8 models~10kNot enough β€” keep collecting
Sep 202630 days~50kWeighted ensemble viable
Oct 202660 days~100kFirst LightGBM training possible
Dec 2026150 days~250kSeasonal patterns emerging
Aug 2027365 days~600kFull annual cycle, robust model

14.10 Success Metrics

14.11 Dependencies & Requirements

ItemStatus
Forecast data collection (8 models, hourly)βœ… Running since Aug 7
Verification engine (MAE per model/city/horizon)βœ… Running daily
MySQL storage for all forecast + evaluation dataβœ… Operational
60+ days of collected data⏳ ~Oct 2026
LightGBM installed on training machineπŸ”² pip install lightgbm
Feature builder scriptπŸ”² To build (Phase 2)
Training pipeline scriptπŸ”² To build (Phase 3)
Inference script for PiπŸ”² To build (Phase 4)