A production-grade ensemble system predicting daily audience attendance across 337 Indian theaters — built with gradient boosting, advance booking signals, and a hand-crafted Indian holiday calendar.
Cinema operators must place concession orders, schedule staff, and allocate screens 72 hours in advance — before they know how many people will actually show up.
For a mid-sized Indian multiplex chain operating 337 screens, a 10% improvement in forecast accuracy translates directly to 6–8% reduction in operational waste — from over-staffed Monday mornings to under-stocked popcorn machines on Diwali weekend.
The ML framing: a multi-entity supervised regression problem with 337 individual time-series, a 53-day forecast horizon, and a target variable shaped by weekly seasonality, Indian holiday culture, advance booking behavior, and Bollywood release calendars.
Cinema managers need per-screen demand forecasts to schedule cleaning crews, ushers, and food & beverage inventory 3–5 days in advance. Poor forecasts cost money at both ends — overstaffing quiet Mondays and running out of stock on Diwali.
Unlike Western markets, Indian cinema attendance is non-stationary. Bollywood blockbusters cause 5x Friday spikes. Diwali creates a multi-day attendance surge. The IPL cricket season suppresses multiplex footfall for 6 consecutive weeks.
Two separate booking platforms — BookNow (advance online) and CinePOS (in-theater) — track the same physical theaters through different identifier systems, requiring a mapping join before any modeling can begin.
When a Bollywood blockbuster starts selling tickets 10+ days out, the advance booking velocity is a forward-looking signal unavailable to standard lag-based models. Exploiting this separates the good solutions from the great ones.
The dataset is a mosaic of two POS systems, theater metadata, calendar info, and a critical bridge table that unifies them all.
Primary target — daily audience count per theater. The supervision signal for the entire model.
Advance booking transactions with timestamps. Source of lead-time and velocity features.
In-theater POS sales. Complementary booking signal via separate ID namespace.
Maps cinePOS IDs → BookNow IDs. The critical bridge that unifies both POS systems.
Theater metadata: lat/lon, type (multiplex/single-screen), area/city.
BN Theater metadata for the POS system. Merged on theater_relation.
Calendar metadata with additional date-level flags for the full date range.
Test set IDs in format {theater_id}_{date}. Defines the 53-day forecast horizon.
The leap from 0.35 to 0.75+ R² was almost entirely a feature engineering story. Every category solves a specific predictability gap.
Same-day-of-week lags are far stronger than raw lag-7: predicting Saturday from last Saturday rather than last Tuesday.
Encodes "what does Theater-042 typically look like on a Saturday in October?" — the single most predictive feature class.
Advance bookings are a leading indicator. High mean lead-time signals a blockbuster before the release date arrives.
35 Indian holidays (2023–2024) with ±3 day proximity windows. Diwali weekend attendance spikes 40–60% above baseline.
5 statistics (mean, std, min, max, median) across 5 windows (7–90 days). The ratio roll_mean_7/roll_mean_14 acts as a momentum indicator.
KMeans (k=10) clusters theaters with similar spatial characteristics. Urban multiplexes vs Tier-3 single-screens behave fundamentally differently.
Five algorithms, each capturing a different aspect of the data. A Ridge meta-learner learns the optimal combination through stacking on out-of-fold predictions.
Leaf-wise growth captures aggressive non-linearities. 2000 estimators, early stopping on 100 rounds. 127 leaves for high model capacity on 174K records.
Level-wise growth produces smoother, more conservative predictions. Complementary regularization profile creates diversity from LightGBM in the ensemble.
Handles theater_area, theater_type, and geo_cluster natively via ordered target statistics — avoiding the target leakage that plagues one-hot encoding.
Bagged averaging and depth constraints prevent extreme predictions, stabilizing the ensemble at distribution extremes. Acts as a conservative baseline.
Individual Prophet models for top theaters capture theater-specific weekly and yearly seasonality that the global models average out. Predictions serve as stacking features.
Trained on out-of-fold predictions from all base models. Learns when to trust each model in different regions of the feature space.
A 124% improvement across four development phases — driven by features, then models, then ensemble design.
Three findings that changed how we thought about the problem.
Average cinema attendance in the 3-day window around major Indian holidays (Diwali, Holi, Eid) was 47% above the baseline for the same weekday. The boost was 60%+ at urban multiplexes.
KMeans clustering on attendance statistics and geography identified 8 distinct behavioral segments — from high-volume stable urban multiplexes to highly volatile small-town single-screens.
Theaters with >200 advance bookings in the 7 days before a show date achieved 80%+ occupancy consistently — confirming advance booking velocity as the strongest leading indicator.
"The jump from 0.35 to 0.58 R² came entirely from features — holiday calendars, advance booking lead-time, same-DOW lags. The jump from 0.58 to 0.79 required better model architecture and ensemble design. The last 0.16 — from 0.79 to 0.95 — would require data we don't have: Bollywood release schedules, competitive intelligence, weather."— Project retrospective on information ceiling analysis
The architecture for a production-grade daily inference pipeline serving 337 theaters simultaneously.
Daily cron job (9AM) pulls from BookNow API and CinePOS webhook, normalizes to Parquet on S3. Airflow DAG manages dependencies and retry logic.
Lag computation from a Redis feature store, holiday calendar lookup, booking aggregations from the last 7 days. Outputs a 337×109 feature matrix.
Serialized LGB/XGB/CatBoost models loaded from MLflow. Ridge meta-learner blends predictions. Post-processing constraints applied in <2 seconds for full batch.
Streamlit dashboard with per-theater 53-day forecast chart, holiday impact overlay, and anomaly alerts (>20% deviation triggers Slack notification).
Time-based split mirrors the test distribution: training on 2023 (174K records), validating on Jan–Feb 2024 (39K records) — the same temporal distance from training end as the test set.
Full source on GitHub — modular pipeline, reproducible experiments, and deployment configs.