← All projects The gym as a whole
Research prototype · Live site · Kaggle

Class Capacity Lab

Which group classes fill up, when, and how predictable it is. Madrid’s municipal sports centres publish places offered and booked for every directed class session. This lab reads 696,283 sessions from 73 centres over four seasons (September 2022 to August 2026), with centre-level bootstrap intervals and a season-to-season check of how well last season ranks this one. A bilingual site presents the case study, an interactive dashboard and a literature-backed discussion.

27.4% 2025-26 sessions fully booked
61.6% Offered places booked in 2025-26
AUC 0.81 Last season ranks which sessions fill
PRODUCT CAPABILITIES

What is implemented today

  • Filter by season, activity family and time slot, with centre-level intervals.
  • See which weekday and time slots fill up and which stay empty.
  • Check how well last season’s record ranks the sessions that fill this season.
  • Follow a research agenda that maps each question to the data and design it needs.

Context

Group classes are planned around a timetable and a room size. Whether a session fills depends on the activity, the centre and the hour, and coaches and managers usually see it only one week at a time.

Problem

Before forecasting demand or changing a timetable, I wanted to know how full sessions really get, which ones fill every time, and whether a simple record of past seasons already predicts which will fill next.

My role

Independent analysis, data cleaning and activity grouping, statistical design, dashboard and site development, literature review and bilingual writing. Original records belong to the Ayuntamiento de Madrid, which does not endorse this project.

What I built

A reproducible Python pipeline from the open season files with hash-checked downloads and logged exclusions, a self-contained dashboard with hand-written SVG charts and a runtime EN/ES layer, a Kaggle notebook that runs offline on the published slot table, and a static site on Vercel.

Data or evidence used

Fully booked sessions rose from 16.3% in 2022-23 to 27.4% in 2025-26 (95% CI 24.7% to 30.3%). Monday evening sessions were full 42.4% of the time, Saturday afternoon 1.2%. Activity was the factor most associated with filling up (Cramér’s V 0.38). Ranking 2025-26 sessions by the same slot’s 2024-25 full rate gave an AUC of 0.81 (0.79 to 0.83).

Limitations

Bookings, not attendance: no-shows and walk-ins are invisible. Season-to-season ranking only covers the 54% to 66% of sessions whose slot existed the season before. One city’s public centres, so prices, members and timetables differ from private gyms.

Next validation step

Add check-in counts per session to separate bookings from attendance, then evaluate calibrated fill probabilities on future weeks before simulating any capacity rule.

DATA AND REPRODUCIBILITY

Source data and published analysis

  1. Ayuntamiento de Madrid. Oferta y ocupación de plazas en actividades deportivas dirigidas (dataset 300076), seasons 2022-23 to 2025-26. Portal de datos abiertos, CC BY 4.0. ↗

    Source of the session records, filtered, regrouped and aggregated for this analysis.

  2. Gómez López, V. A. (2026). Class Capacity Lab: Madrid Group Class Occupancy. Kaggle. ↗

    Notebook that runs offline on the published slot table and recovers the same numbers as the local pipeline.

  3. Gómez López, V. A. (2026). Class Capacity Lab: evidence & discussion. ↗

    Discussion of the findings against literature on capacity, no-shows, calibration and overbooking, with a research agenda.

PythonpandasNumPyJavaScriptSVGKaggleVercel
CONNECTED WORK

Keep exploring

See the full project map →