---
id: 18644
lang: en
title: "Customer Base Forecast: An Ensemble with a Neural Network Cut Error from 2.17% to 1.8%"
published_at: "2026-11-29 16:36:27"
source_name: "Habr AI"
source_url: "https://habr.com/ru/articles/1104300/?utm_campaign=1104300&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/18644"
categories: ["research", "business"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# Customer Base Forecast: An Ensemble with a Neural Network Cut Error from 2.17% to 1.8%

> **Краткая суть (BLUF):** Businesses need to know how many unique customers will place at least one order in a month. This is the MAU, the monthly active user base. The Prophet forecast was off by 2.17% on average at month's end, while a simple formula, last year's curve multiplied by a growth coefficient, was off by 2.08%. An ensemble of the TSMixer neural network and this formula cut the error to 1.8%, but required modeling 79 cities separately. So with such a modest gain in accuracy, it is better to change the problem setup rather than the model.  - Tuning about 50 Prophet configurations gained only 0.1 pp, which amounts to fitting to noise - TSMixer across 79 cities: 2.0% error on 90,000 observations - Customers who buy in two cities are counted only in their home city to avoid duplicates

"Everything already works, we just need to improve it a little" is the kind of statement that usually precedes surprises. That is where the task began, the one the author covers on Habr: forecasting the monthly active customer base, abbreviated MAU. This is the number of unique buyers who placed at least one order since the start of the calendar month. The director cared less about hitting an intermediate point on the chart than about answering a practical question: "If today is the 10th, how many customers will we have by the end of the month?" This is the second part of a series on the P.E.S.E.Ts system, which forecasts revenue, orders, and units sold. The usual recipe of "take a neural network and build an ensemble" delivered a gain here, but a modest one.

## Why people are harder to count than money

Orders and revenue can be added up day by day: 100,000 orders today and 120,000 tomorrow give 220,000. People don't add up that way. If 40,000 of tomorrow's buyers already ordered yesterday, the base grows by only 80,000, so over two days there are 180,000 people. Within a month, such a base only grows, and on the first day the counter resets to zero. The chart ends up looking like a sawtooth.

For forecasting, this creates three problems. The series restarts every month, and months last from 28 to 31 days. Growth slows down: the more regular customers have already ordered, the slower the base grows. Finally, one curve mixes newcomers, returning customers, promotions, and the calendar.

Quality was measured by end-of-month error, EOM MAPE. This is the average percentage deviation between the forecast of the final base and the actual figure, averaged over all days of the calculation. For each day, the model saw only the facts up to yesterday and predicted growth for the remaining days.

## The path there: from Prophet to a neural network

The old solution used Prophet to forecast not the monthly sawtooth but a rolling base over the last 30 days. A chain of adjustments for month length and the historical profile then turned it into the calendar-month total. The old backtest had two flaws: it tested only Prophet itself, and it let the model peek at the actual future values of inflation, the key rate, and discounts. The author removed the leak: macroeconomic variables were carried forward at their last known values, and discounts were taken from commercial plans. The honest error came to 2.17%, and in some periods it ran at 5–7% for several days in a row.

Regular hyperparameter search didn't help either. Each run tried about 50 Prophet configurations, but compared with a single fixed one the gain was only 0.1 pp. In effect, the model was being fitted to the noise of the last few weeks.

Next, the author took the simplest approach: the trajectory of the same month last year, multiplied by a growth coefficient. If there were 15% more customers last month than a year earlier, the curve is multiplied by 1.15. The full previous month proved to be the best window for the coefficient. The error was 2.08%, which beat the complex Prophet chain.

For a neural network at the country level, there is too little data: three years of history gives about 1,100 points. So the forecast was broken down to 79 cities, roughly 90,000 observations. This raised the problem of "double-counted" people: a customer who orders from home in Moscow and, while traveling, from St. Petersburg, appears in the base of two cities even though there is only one of them in the country. Each buyer was counted only in their home city, defined as the city with the most orders over the last three months. The double-counting effect was under 1%, but the author wanted to remove it properly.

The TSMixer neural network was chosen because boosting methods such as CatBoost are poorly suited to forecasting an entire curve 45 days ahead. Results by EOM error:

- Prophet on rolling MAU: 2.17%
- annual seasonality: 2.08%
- TSMixer by city: 2.0%
- TSMixer combined with seasonality: 1.8%

## The cost of the gain and the way back

The ensemble is more accurate than each model on its own, but seasonality alone was enough with last year's curve and one coefficient. TSMixer requires city-level detail, distribution of people across home cities, a complex feature set, and maintenance of two model pipelines. For a small gain over a basic formula, that is expensive. All approaches, from Prophet to the neural network, were trying to guess the shape of the same final curve, so the author decided to change not the model but the problem setup.

He split MAU into two non-overlapping flows. Inflow is the first orders from newcomers and from customers who returned after a break of more than 365 days. Returns are the first orders of the month from those who bought within the last year. The end-of-month forecast equals the accumulated actual value plus future inflow plus future first returns. Returns are estimated from a snapshot of the base at the start of the month: users are grouped by city, segment, time since last order, and number of orders over the last 60 days.

## What to take away

If an ensemble of a neural network and a simple formula gives a modest gain at a multiple increase in complexity, it is worth reconsidering the problem setup. Check the entire calculation chain, not just one model. Make sure no future information leaks into the test. Establish a simple baseline formula against which you honestly compare everything else. Limitations: the figures come from an internal backtest of a single service, and the available part of the material does not report the final accuracy of the approach with its components.

---
- **Первоисточник:** [Habr AI](https://habr.com/ru/articles/1104300/?utm_campaign=1104300&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18644
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
