End-to-end machine learning platform for League of Legends analytics with a FastAPI backend, React frontend, Riot API integration, and MLflow experiment tracking.
- Khalil Ayeb
- Melek Bouabid
Build and evaluate machine-learning models using Riot API match data to predict:
- match outcomes
- player rank tier
- smurf anomalies
- rank progression
while identifying which gameplay features most influence these predictions.
See data/processed/README.md for the updated feature dataset schema.
- Trained and integrated 4 core prediction modules:
- Rank Tier Classification
- Progression Regression
- Smurf Anomaly Detection
- Match Outcome Prediction (multiple variants)
- Built a production-style API layer with FastAPI (
/api/v1). - Connected frontend pages to live backend endpoints.
- Added Riot API resilience features (cache + retry/backoff + health status mapping).
- Added UI/UX improvements: skeleton loading, retry cooldown, status badges, cache age and timestamps.
- MLflow is used to track experiments, metrics, artifacts, and model runs.
- Local tracking data is stored under
mlruns/and artifacts undermlartifacts/. - Setup and comparison scripts are available in
scripts/3_model_training/.
mlflow ui --port 5000Open: http://127.0.0.1:5000
scripts/3_model_training/mlflow_setup.py→ initialize experimentsscripts/3_model_training/train_all_models.py→ train models with trackingscripts/3_model_training/mlflow_model_comparison.py→ compare runs
- Rank Tier Classifier
- Predicts rank tier from player performance features.
- Progression Regressor
- Predicts win-rate/skill progression tendency.
- Smurf Detector
- Anomaly-based detector for suspiciously high-skill behavior.
- Match Outcome Predictor
- Supports
early,full,strict, andcascadevariants.
- Supports
- Covers classification + regression + anomaly detection for complete player analysis.
- Enables both offline evaluation and live API inference.
- Match outcome variants support different feature availability windows.
- Python dependencies:
requirements.txt - Settings source: environment variables in
.env - Main app entry:
api/main.py - Config object:
api/core/settings.py
.venv\Scripts\python.exe -m uvicorn api.main:app --host 127.0.0.1 --port 8001- Base URL:
http://127.0.0.1:8001 - Prefix:
/api/v1 - Docs:
/docs - OpenAPI JSON:
/openapi.json
GET /api/v1/healthGET /api/v1/health/riot
GET /api/v1/match-outcome/modelsPOST /api/v1/match-outcome/predict/earlyPOST /api/v1/match-outcome/predict/fullPOST /api/v1/match-outcome/predict/cascadePOST /api/v1/match-outcome/predict/strict
POST /api/v1/rank/predictPOST /api/v1/progression/predictPOST /api/v1/smurf/predictPOST /api/v1/summoner/predict
- Response cache for summoner prediction endpoint.
- Retry with exponential backoff for transient Riot failures.
- Health mapping for key states (active / expired / rate-limited / unreachable).
- Start backend server.
- Open
http://127.0.0.1:8001/docs. - Expand an endpoint (for example
POST /api/v1/rank/predict). - Click Try it out.
- Paste a valid JSON payload.
- Click Execute and inspect response + status code.
GET /api/v1/healthGET /api/v1/match-outcome/modelsPOST /api/v1/summoner/predict(requires valid Riot API key)
- React + TypeScript + Vite
- Routing with React Router
- Charts/visualization with Recharts
cd "frontend/hextech-insights (1)"
npm install
npm run devOpen: http://127.0.0.1:5173
- Removed duplicate summoner search UI in Live Analytics flow.
- Added model-card navigation from Model Dashboard to Predictions page.
- Added a compare-players page with side-by-side metrics.
- Added “Why This Prediction” explainability cards.
- Added loading skeletons, retry cooldown, empty states, Riot status badge, and update timestamps.
- Frontend API client is centralized in
frontend/hextech-insights (1)/services/api.ts. - Uses
VITE_API_BASE_URL(default:http://127.0.0.1:8001/api/v1). - Predictions and profile flows are linked to backend endpoints and typed responses.
- User action from frontend page.
- Frontend calls FastAPI endpoint.
- Backend loads model/service and returns prediction payload.
- Frontend renders metrics, charts, explanations, and status indicators.
- Replace expired Riot dev key with active key to fully validate live summoner pipeline end-to-end without fallback mode.
- Add Docker Compose for one-command startup (backend + frontend + MLflow).