Авторский курс Елизаровой НаталииAuthor's course by Nataliia Elizarova
Открытый урок · 04-01-01Open lesson · 04-01-01

От классики к ML в прогнозе спросаFrom classic methods to ML in demand forecasting

Классические методы смотрят только в прошлое ряда. Машинное обучение умеет учитывать ещё и то, что вы знаете о будущем: акции, праздники, погоду. В этом уроке вы сами включите модели эти «подсказки» по одной и увидите, какая из них даёт больше всего точности — и где прячется ловушка.

Classic methods look only at the series' own past. Machine learning can also use what you know about the future: promos, holidays, weather. In this lesson you will switch these "hints" on one by one and see which one adds the most accuracy — and where the trap is hiding.

⏱ 20 минут⏱ 20 minutes 🤖 Интерактив «Классика против ML»🤖 Interactive: "Classic vs ML" ✅ В конце — тест из 8 вопросов✅ An 8-question quiz at the end

После урока вы сможетеAfter this lesson you will be able to

  • объяснить, чего не видит классический метод и что добавляет машинное обучение;
  • назвать «подсказки» для модели и проверить, известны ли они на будущее;
  • понять, почему модель не всегда выигрывает у простого прогноза;
  • разобраться, кто что делает в ML-проекте: планер, Claude и Python.
  • explain what a classic method misses and what machine learning adds;
  • name the "hints" for a model and check whether they are known for the future;
  • see why a model does not always beat a simple forecast;
  • understand who does what in an ML project: the planner, Claude and Python.
1

Что умеет классика и чего не видитWhat classic methods do and what they miss

MA, ES, Holt–Winters из прошлых уроков отлично продолжают уровень, тренд и сезон. Но у них есть одно ограничение: они видят только сами продажи. Про акцию в сети на следующей неделе, жаркий июль или праздник они ничего не знают.

MA, ES and Holt–Winters from earlier lessons continue level, trend and season very well. But they share one limit: they see only the sales themselves. A chain promo next week, a hot July or a holiday — they know nothing about these.

АналогияAnalogy Классический метод — водитель, который смотрит только в зеркало заднего вида. На прямой дороге этого хватает: дорога впереди такая же, как позади. ML — водитель, который смотрит ещё и в лобовое стекло и знает: через километр поворот (акция), впереди жара (погода), в пятницу праздник. A classic method is a driver looking only in the rear-view mirror. On a straight road that is enough: the road ahead looks like the road behind. ML is a driver who also looks through the windscreen and knows: a bend in a kilometre (a promo), heat ahead (weather), a holiday on Friday.

📊 Классический метод📊 A classic method

Вход: только история продаж.
Видит: уровень, тренд, сезон.
Плюсы: просто, быстро, понятно, работает в Excel.

Input: sales history only.
Sees: level, trend, season.
Pluses: simple, fast, clear, works in Excel.

🤖 Машинное обучение🤖 Machine learning

Вход: история + подсказки (акции, цены, погода, праздники).
Само находит, насколько каждая подсказка двигает продажи.
Минусы: нужны чистые данные и честная проверка.

Input: history + hints (promos, prices, weather, holidays).
Finds by itself how much each hint moves sales.
Minuses: needs clean data and honest testing.

2

Подсказки для модели и главный вопрос о нихHints for the model, and the key question about them

Подсказки по-английски называют features (признаки). Модель учится на прошлом: «вот неделя с акцией — продали столько-то». Но прогнозировать она сможет, только если подсказка известна и на будущее.

Hints are called features. The model learns from the past: "here is a promo week — this much was sold". But it can forecast only if the hint is also known for the future.

ПодсказкаHintИзвестна на будущее?Known for the future?
📅 Календарь: месяц, день недели, праздники📅 Calendar: month, weekday, holidaysДа, всегдаYes, always
🏷 План акций и цен🏷 Promo and price planДа, если его согласовали с маркетингом и сетямиYes, if agreed with marketing and the chains
🏪 План дистрибуции: в скольких магазинах будет товар🏪 Distribution plan: how many stores will stock itДа, от отдела продажYes, from the sales team
🌡 Погода🌡 WeatherНа 1–2 недели — да. На год вперёд — нет, только «обычная»For 1–2 weeks — yes. A year ahead — no, only "normal"
📦 Продажи прошлой недели📦 Last week's salesДля прогноза на год вперёд — нет: к нужному месяцу их ещё не будетFor a year-ahead forecast — no: they will not exist yet for the target month
ЗапомнитьRemember Если модели на проверке дали подсказку, которой в настоящем прогнозе не будет, точность получится красивой, а прогноз — плохим. Это называется утечка (data leakage): модель «подсмотрела» будущее. If, in testing, the model got a hint that the real forecast will not have, accuracy looks great while the forecast is poor. This is called data leakage: the model "peeked" at the future.
3

Интерактив: классика против MLInteractive: classic vs ML

Холодный чай «Долины напитков» в одном городе, продажи по неделям, тысяч бутылок. Модели учились на 2025 годе и прогнозируют 2026-й. В 2026 году акции прошли в другие недели, чем в 2025-м, а жара пришла позже. Выберите классический метод, включайте подсказки для ML и смотрите на точность.

"Valley Beverages" iced tea in one city, weekly sales, thousand bottles. The models learned on 2025 and forecast 2026. In 2026 promos ran in different weeks than in 2025, and the heat came later. Pick a classic method, switch hints on for ML and watch the accuracy.

📊 Классика📊 Classic

🤖 ML: тренд + сезон + подсказки🤖 ML: trend + season + hints

Факт 2026Actual 2026КлассикаClassicML

Что вы должны были увидетьWhat you should have seen
  • «Как год назад» — около 84 %: он переносит прошлогодние акции на те недели, где их в этом году нет.
  • «Тренд + сезон» — около 90 %: уже лучше, но пики акций он не видит совсем.
  • ML с акциями — около 94 %: больше всего точности дал план акций, а не сложность модели.
  • ML со всеми подсказками — около 97 %, но только если знать погоду заранее. С обычной погодой — около 95 %.
  • "Same as last year" — about 84%: it moves last year's promos onto weeks where there are none this year.
  • "Trend + season" — about 90%: better already, but blind to promo peaks.
  • ML with promos — about 94%: the promo plan added the most accuracy, not model complexity.
  • ML with all hints — about 97%, but only if the weather is known in advance. With normal weather — about 95%.
Главная мысльKey idea Модель сильна не «умностью», а подсказками, которые известны на будущее. Самая ценная подсказка у напитков — план акций. И его даёт не модель, а маркетинг и отдел продаж. Без этой информации ML превращается в обычный «тренд + сезон». A model is strong not because it is "smart" but because of hints known for the future. The most valuable hint for drinks is the promo plan. And it comes not from the model but from marketing and sales. Without it, ML turns into ordinary "trend + season".
4

Цифры из мира: соревнование M5Numbers from the real world: the M5 competition

В 2020 году прошло соревнование M5 на настоящих продажах крупнейшей розничной сети мира. Тысячи команд прогнозировали одни и те же ряды.

In 2020 the M5 competition ran on real sales from the world's largest retailer. Thousands of teams forecast the same series.

42 84042,840рядов: продажи товаров Walmart по магазинам, штатам и категориямseries: Walmart product sales by store, state and category
LightGBMна основе этого метода машинного обучения (градиентный бустинг деревьев) строили большинство лучших решений, включая победителяthis machine learning method (gradient-boosted trees) was the basis of most top solutions, including the winner

Что это значит для планера: ML действительно помогает, особенно когда товаров тысячи и у них общие закономерности. Но на уровне отдельного товара в отдельной точке шум велик, и чуда не будет. Поэтому любой ML-прогноз сравнивают с простым на том уровне, где принимают решения.

What it means for a planner: ML really helps, especially with thousands of products sharing patterns. But at the level of one product in one store, noise is high and there are no miracles. That is why any ML forecast is compared with a simple one at the level where decisions are made.

Источники: Makridakis, Spiliotis, Assimakopoulos, «M5 accuracy competition: Results, findings, and conclusions», International Journal of Forecasting, 2022.

Sources: Makridakis, Spiliotis, Assimakopoulos, "M5 accuracy competition: Results, findings, and conclusions", International Journal of Forecasting, 2022.

5

Кто что делает: планер, Claude и PythonWho does what: the planner, Claude and Python

Частый вопрос: «ML — это значит, прогноз считает искусственный интеллект вроде Claude?» Нет. В современном ML-проекте три участника, и у каждого своя роль.

A common question: "ML means an AI like Claude makes the forecast?" No. A modern ML project has three participants, each with its own role.

👩‍💼 Планер👩‍💼 The plannerСтавит задачу, знает данные (где был дефицит, где акция), проверяет цифры глазами и решает, какой прогноз отдать.Sets the task, knows the data (where the stock-outs and promos were), checks the numbers by eye and decides which forecast goes out.
💬 Claude💬 ClaudeАссистент: пишет и объясняет код, находит ошибки в данных, собирает таблицы и дашборды. Прогноз сам не считает.The assistant: writes and explains code, finds data errors, builds tables and dashboards. It does not make the forecast itself.
🐍 Python🐍 PythonСчитает: обучает модель на истории и выдаёт прогноз на тысячи товаров за минуты.Calculates: trains the model on history and forecasts thousands of products in minutes.

Вам не нужно становиться программистом. Нужно уметь сформулировать задачу, понимать, что модель видит, и проверять результат. Если вы знаете функции ТЕНДЕНЦИЯ или ЛИНЕЙН в Excel, вы уже знаете суть: «научить по прошлому» и «посчитать на будущее».

You do not need to become a programmer. You need to state the task, understand what the model sees and check the result. If you know Excel's TREND or LINEST, you already know the essence: "learn from the past" and "calculate the future".

6

Как это бывает в жизниHow it happens in real life

Три случая из настоящего ML-проекта годового прогноза в компании-производителе напитков. Названия изменены.

Three cases from a real annual ML forecasting project at a beverage manufacturer. Names are changed.

1. Жара, которая объяснила всё1. The heat that explained everything

Что случилосьWhat happened
Модель решила, что каждый градус жары добавляет 15 % продаж.The model decided each degree of heat adds 15% to sales.
Что на самом делеWhat was really going on
Два лета подряд были жаркими, и в те же месяцы вышли новинки. Модель не отличила одно от другого и приписала весь рост погоде.Two summers in a row were hot, and new products launched in the same months. The model could not tell them apart and credited all growth to the weather.
ПравилоRule
Если два события совпали по времени, модель их не разделит. Проверяйте подсказки здравым смыслом.If two events coincide in time, the model cannot separate them. Check hints with common sense.

2. Выиграла на итоге, проиграла на товаре2. Won on the total, lost on the product

Что случилосьWhat happened
По стране в целом ML-прогноз оказался точнее «как год назад». Решили, что модель лучше.For the country as a whole the ML forecast beat "same as last year". The model was declared better.
Что на самом делеWhat was really going on
На уровне «товар × город», где планируют склад, модель проиграла: её ошибки по разным товарам гасили друг друга в сумме.At "product × city" level, where stock is planned, the model lost: its errors on different products cancelled out in the total.
ПравилоRule
Точность меряют там, где принимают решения: товар × город × месяц.Measure accuracy where decisions are made: product × city × month.

3. Крупный товар, упавший в 8 раз3. A large product that fell eightfold

Что случилосьWhat happened
Общая модель получила новинку с одним-двумя месяцами истории и «уронила» прогноз в 8 раз. В сумме по стране это почти не было видно.The global model got a new product with one or two months of history and "dropped" its forecast eightfold. In the country total it was barely visible.
Что на самом делеWhat was really going on
Модели не на чем было учиться. Короткие ряды надо было считать просто, а крупные — смотреть глазами.The model had nothing to learn from. Short series should have been calculated simply, and large ones checked by eye.
ПравилоRule
Визуальная проверка обязательна: после каждого расчёта смотрим графики крупнейших товаров.A visual check is mandatory: after every run we look at the charts of the largest products.
7

Три мифа про ML в прогнозеThree myths about ML in forecasting

Миф:Myth: ML заменит планера.ML will replace the planner.
На самом деле:In fact: модель берёт на себя тысячи расчётов, а планер — данные, здравый смысл и решение. Без планера модель учится на ошибках истории.the model takes over thousands of calculations; the planner owns the data, common sense and the decision. Without a planner the model learns history's mistakes.
Миф:Myth: ML нужен всегда.ML is always needed.
На самом деле:In fact: если продажи ровные и факторов нет, Holt–Winters или «как год назад» дадут то же самое — быстрее и понятнее.if sales are flat and there are no drivers, Holt–Winters or "same as last year" give the same result — faster and clearer.
Миф:Myth: ML — это когда прогноз делает чат-бот.ML means a chatbot makes the forecast.
На самом деле:In fact: прогноз считает модель на Python. ИИ-ассистент помогает написать код и найти ошибки, но цифру он не придумывает.a Python model makes the forecast. An AI assistant helps write the code and find errors, but it does not invent the number.
8

Готовы ли вы к ML? Отметьте, что уже естьAre you ready for ML? Tick what you already have

Меньше половины галочек — начните с классики и чистки данных. Это не шаг назад: это фундамент, на котором ML потом работает.

Fewer than half ticked — start with classic methods and data cleaning. That is not a step back: it is the foundation ML later stands on.

9

Проверьте себяCheck yourself

10

Шпаргалка терминовGlossary

Machine Learning (ML)машинное обучение: компьютер сам находит правило по примерамthe computer finds the rule from examples by itself
Featuresподсказки (признаки): акции, цены, погода, праздники, календарьhints: promos, prices, weather, holidays, calendar
Training / Testобучение на прошлом / проверка на периоде, которого модель не виделаlearning on the past / testing on a period the model never saw
Data leakageутечка: модель «подсмотрела» будущее на проверкеthe model "peeked" at the future in testing
Baselineбазовая линия: прогноз без событийthe forecast without events
Gradient boosting (LightGBM, XGBoost)много маленьких деревьев решений, каждое исправляет ошибки предыдущихmany small decision trees, each fixing the previous ones' errors
FVA (Forecast Value Added)насколько метод улучшил прогноз против простогоhow much a method improved on the simple forecast
M5соревнование по прогнозу продаж розницы, 2020a retail sales forecasting competition, 2020
Pythonязык программирования, на котором считают моделиthe programming language models run in
AI assistant (Claude)ИИ-ассистент: пишет код и объясняет, прогноз не считаетwrites and explains code; does not make the forecast
Итог урокаLesson summary Классика продолжает прошлое, ML добавляет известное о будущем. Самый большой выигрыш дают подсказки, которые правда известны заранее, — у напитков это план акций. Сравнивайте модель с простым прогнозом на уровне товар × город и всегда смотрите крупные позиции глазами. Classic methods continue the past; ML adds what is known about the future. The biggest gain comes from hints that are truly known in advance — for drinks, the promo plan. Compare the model with a simple forecast at product × city level and always check the large items by eye.

Это только началоThis is just the beginning

Вы увидели, как подсказки делают прогноз точнее. В полном курсе — 29 уроков машинного обучения на реальном кейсе годового прогноза: планер ставит задачу, Claude пишет код, Python считает, а вы проверяете и решаете.

You have seen how hints make a forecast more accurate. The full course has 29 machine learning lessons on a real case of an annual forecast: the planner sets the task, Claude writes the code, Python calculates, and you check and decide.

  • гигиена данных и подсказки: дефицит, акции, переключения кодов, календарь;
  • как не подглядывать в будущее и честно проверять модель;
  • Prophet, бустинг, нейросети — простыми словами, на пальцах и на учебных данных;
  • объяснение прогноза для бизнеса, автоматизация и переход от Excel к ML по шагам;
  • Excel-книга и скрипт Python в каждом уроке — на учебной «Долине напитков».
  • data hygiene and hints: stock-outs, promos, code switches, calendar;
  • how not to peek into the future and test a model honestly;
  • Prophet, boosting, neural networks — in plain words, step by step, on training data;
  • explaining the forecast to the business, automation and a step-by-step move from Excel to ML;
  • an Excel workbook and a Python script in every lesson — on the "Valley Beverages" training set.
Made on
Tilda