The task of scouting the playbook (i.e. often used plays) of an upcoming opponent in professional basketball often requires hours of manual labor, with only a small proportion of it requiring the domain expertise of the coaches carrying out the task. Yet the task is not easily solved by an algorithm or an ML agent due to its dynamic nature, missing ground truth and specific mental models of the coaches. We present the mixed-initiative system DeepPlaybook that enables easy exploration, organization, and presentation of Basketball plays in an interactive dashboard. A transformer model trained on finding tactically similar plays supplies high-dimensional embeddings that are downprojected using supervised UMAP. Each point in the interactive clustering plot corresponds to a downprojected play sequence.
Try out the live version at https://fp-p3.xaiml25.ivia.ch/
- Mike Boss
- Konstantin Heep
- Romeo Stoll
This dashboard provides comprehensive analysis of NBA player movement patterns through:
- Data visualization of generated play clusterings and player tracking data
- Machine learning models for finding similar plays (using trajectory prediction)
- Interactive components for exploring opponent team offensive tactics
basketball-analytics/
├── frontend/ # React.js dashboard with TypeScript
├── backend/ # Python API server with Flask API
├── backend/model/ # ML preprocessing, transformer model training pipeline
└── docker-compose.yml # Development environment
- Docker and Docker Compose
- Node.js 18+ (for local frontend development)
- Python 3.13+ (for local backend development)
-
Clone and setup environment:
git clone <repository-url> cd basketball-analytics
-
Start all services:
docker compose up
Services will be available at:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8080/api/v1/
For detailed setup instructions:
- Frontend: See frontend/README.md
- Backend: See backend/README.md
- ML Models: See model/README.md
- Raw NBA tracking data → Stored in
backend/data/nba_tracking_data/ - Preprocessing → ML model training and feature extraction
- Clustering → Initial position clusters computed and cached
- Video rendering → Synchronized tracking overlays
- API serving → Data access for frontend and interaction loop for user feedback
- Adding teams: Update
TEAM_IDS_SAMPLEinbackend/settings.py - Reprocessing data: Run
uv run python scripts/prepare_data.py - Updating clusters: Run
uv run python src/backend/resources/scatter_data.py - Regenerating videos: Run
uv run python scripts/prerender_videos.py
Automatically on merge to main branch by CI/CD pipeline.
- Pitch Video: Project Presentation
- Documentation: See individual component READMEs
