AquaPlan Reis

ML model for forecasting remaining water volume

The model forecasts hourly water sales across a regional network of water vending machines. Subtracting expected sales from the morning reading gives the volume left at the selected time.

Estimated volume remaining
697L
The morning reading was 825 L. Values between hours are estimates and assume no refill.

Training the model

1 800 578hourly sales observations

31 March 2020 to 22 November 2026

64
water vending machines
6
winters in the sales history
13 796
refill records used to check the water balance
18 hours
morning forecast horizon

Training details

CatBoost

Gradient boosting with symmetric trees

Each hourly record includes the actual volume sold. The model learned to predict it using only information available by 06:00. We measured the mean absolute error (MAE) in litres between predicted and actual sales.

400

decision trees

The trees are trained in sequence. Each tree adjusts the prediction made by the preceding trees. The model adds their contributions to produce the forecast.

Up to 6

conditions along a tree path

At each level, a condition on a feature sends the observation down one of two branches. The model has 399 trees of depth 6 and one tree of depth 4.

0.06

learning rate

Each new tree’s adjustment is multiplied by 0.06, so the forecast changes in small steps.

Training hardware

AMD Ryzen 9 9950X

Windows · 2 CPU threads

The workstation also has an NVIDIA GeForce RTX 5080 with 16 GB of memory. This CatBoost run used the CPU.

Software

Python
3.12.10
CatBoost
1.2.10
NumPy
2.5.5

42predictors

Calendar and time

13 features
Time
forecast hour, hours since the morning forecast
Week
day of the week, weekend day, working day, whether yesterday was a working day, whether tomorrow is a working day
Year
month and two coordinates of the annual cycle (sine and cosine)
Holidays
public holiday, day before a holiday, day after a holiday

Averages and trends

14 features
At the same hour
average sales over 7, 14, 28, 56, 91 days and observation counts over 7, 14, 28, 56, 91 days
Over 8 weeks
mean, median, observation count for the same weekday and hour
Change in demand
difference between 7-day and 28-day average sales

Recent sales

7 features
Midnight to 06:00
average hourly sales, observation count
Yesterday
sales at the same hour, total daily sales, hours with data
At the same hour
sales exactly 7 days earlier and exactly 14 days earlier. If the 14-day value is missing, the 7-day value is used.

Machine history

3 features
Machine
machine identifier
Data recency
days since the last reading at this hour
History length
days since the machine’s first record

Previous season

2 features
Around the same week last year
average sales at the same hour, readings at this hour

Auxiliary meter

3 features
Yesterday
metered consumption at the same hour
Over 7 days
average metered consumption at the same hour, meter readings at this hour