Work / 02 Government / Public Sector
A government agency that aggregates financial-transaction data had years of history and no way to see where volumes were heading. We built a forecasting model and a web platform that lets planners explore trends and run their own forecasts.
- Client
- Government / Public Sector
- Engagement
- 5 months
- Delivered
- 2024
ServicesAnalyticsData engineering
- Forecast error (MAPE)−31%
- Time to produce a forecastDays to minutes
- Cost savings from allocation12%
The brief
What they came to us with.
The agency tracks and aggregates financial transactions across states, applications and purposes. The data was comprehensive, but without trend analysis or prediction it could only describe the past.
Planning relied on judgement. The agency wanted hidden patterns surfaced, future trends forecast, and resources allocated against both.
Constraints
- Sensitive data protected end to end
- Forecasts that account for seasonality, trends and holidays
- Non-technical users can generate their own forecasts
- Built on the agency’s own internal data sources
Before and after
What actually changed.
From describing last quarter to planning the next one.
What we did
How the forecast is built.
- 01
Build one trustworthy dataset
We gathered historical transactions from the agency’s internal sources, across states, applications and purposes. The data was cleaned, standardised and enriched with external economic indicators and metadata.
Fig. 1 From scattered sources to a forecast-ready datasetDiagram - 02
Choose a model that explains itself
Prophet suits time series with strong seasonality, trend shifts and holidays, and it accepts multiple seasonalities and external regressors. Careful hyperparameter tuning raised accuracy, and every forecast comes with a range.
Fig. 2 History, forecast and the range around itDiagram - 03
Put forecasting in planners’ hands
A Flask web application wraps the model: charts, trend analysis and custom forecasts with a what-if view. Security controls protect the sensitive data behind it.
Fig. 3 The forecast explorer, simplifiedDiagram
How it ran
How the work was paced.
The data foundation first, so every later step stood on solid ground.
Data foundation
Gather, clean, standardise and enrich the history.
Modelling and tuning
Train, tune and backtest the forecasting model.
Platform build
Web application, charts, trend analysis, what-if.
Security and handover
Access controls, documentation, training.
Outcome
What it changed.
Compared with the traditional methods the agency used before.
Forecast error (MAPE)
−31%
Before14.2%After9.8%
How measured: Mean absolute percentage error on held-out months, previous method against the model.
Time to produce a forecast
Days to minutes
Before2 daysAfter10 min
How measured: Time for a planner to produce a new forecast for a chosen state and purpose.
Cost savings from allocation
12%
BeforeBaselineAfter12% lower
How measured: Resource spend in planning cycles that used the forecast, against the prior baseline.
Built with
PythonEverything glued together
FlaskPython web apps
- Prophet
What we would tell the next team
- Cleaning and standardising the data took the longest and moved accuracy the most.
- A forecast with a visible range earned more trust than a single number.
- The what-if view was what turned planners from readers into users.
More work
Contact
Book a free 15-minute call to talk through what you are working on.
How we connect
- 01Book a short call
Choose a time that works for you on our calendar.
- 02Discovery call
A short call to understand the problem, the people and the constraints.
- 03Final scope and kickoff
We send a clear scope and cost. Once you agree, we start.
Office
393, WeWork Vijohn Tower, 3rd FloorUdhyog Vihar Phase-4, GurugramHaryana 122016
Follow