Skip to content

rstol/fp-p3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

237 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DeepPlaybook: Basketball Play-by-Play Analytics Dashboard

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/

Team Members

  1. Mike Boss
  2. Konstantin Heep
  3. Romeo Stoll

Project Overview

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

Project

DeepPlaybook

Report

Architecture

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

Quick Start

Prerequisites

  • Docker and Docker Compose
  • Node.js 18+ (for local frontend development)
  • Python 3.13+ (for local backend development)

Development Setup

  1. Clone and setup environment:

    git clone <repository-url>
    cd basketball-analytics
  2. Start all services:

    docker compose up

    Services will be available at:

Individual Service Setup

For detailed setup instructions:

Data Pipeline

  1. Raw NBA tracking data → Stored in backend/data/nba_tracking_data/
  2. Preprocessing → ML model training and feature extraction
  3. Clustering → Initial position clusters computed and cached
  4. Video rendering → Synchronized tracking overlays
  5. API serving → Data access for frontend and interaction loop for user feedback

Development Workflow

Working with Data

  • Adding teams: Update TEAM_IDS_SAMPLE in backend/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

Deployment

Automatically on merge to main branch by CI/CD pipeline.

Resources

About

DeepPlaybook, a mixed-initiative system that combines deep learning with interactive visualization for efficient exploration and analysis of basketball plays.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages