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

outcomesummaryClient name withheld
  • 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 changedbefore
Data
Transactions spread across several sources
States, applications and purposes handled separately
Method
Trends read by eye
No predictive model
Insight
Hidden patterns went unseen
History only
Decisions
Resources allocated on past averages
Slow reaction to shifts
A clear record of the past, and a guess about what came next.

What we did

How the forecast is built.

  1. 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.

    SourcesPrepareReadyState dataApplication dataPurpose dataClean and standardisequality checks on every loadEconomic indicatorsForecast-ready dataset
    Fig. 1  From scattered sources to a forecast-ready datasetDiagram
  2. 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.

    Jan Y1Jan Y2Jan Y3Jan Y4Forecast startsActualForecastRange
    Fig. 2  History, forecast and the range around itDiagram
  3. 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.

    Forecast explorerOverviewTrend analysisWhat-ifRegionApplicationPurposeHorizon: 12 monthsForecast with rangeNext 12 months+6.4%vs last yearBusiest monthMonth 9Scenario Add a holiday, change an indicator, re-run in seconds
    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.

Data

Modelling and tuning

Train, tune and backtest the forecasting model.

Model

Platform build

Web application, charts, trend analysis, what-if.

Platform

Security and handover

Access controls, documentation, training.

Hand-over
Durations are in weeks
Wk 06121824

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.


Contact

Book a free 15-minute call to talk through what you are working on.

How we connect

  1. 01Book a short call

    Choose a time that works for you on our calendar.

  2. 02Discovery call

    A short call to understand the problem, the people and the constraints.

  3. 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

LinkedIn