weltby Ergodic Sign inGet started
All use cases

How Much Will Each Store Sell in the Next Two Weeks?

How much stock should each store order for the next fortnight? Order too little and shelves go empty at the weekend. Order too much and cash sits in the stockroom. A planner needs a number for each store and each day, and a sense of how wrong it could be.

Use caseCustomersForecastingPrediction

The table

One row per store per day: the date, the store and the units sold. The walkthrough builds a year of daily sales for three stores so it runs anywhere. Swap in your own history with the same three columns.

Walkthrough

  1. Get the history

    A year of daily sales for three stores, busier at weekends.

    import numpy as np
    import pandas as pd
    
    rng = np.random.default_rng(0)
    days = pd.date_range("2025-01-01", periods=365, freq="D")
    history = pd.concat([pd.DataFrame({
        "date": days, "store": store,
        "sales": level * (1 + 0.3 * (days.dayofweek >= 5)) + rng.normal(0, 5, len(days)),
    }) for store, level in {"north": 120, "south": 90, "east": 60}.items()], ignore_index=True)
  2. Forecast every store at once

    Chronos-2 reads all three series in one request.

    from welt import Forecast
    
    model = Forecast(model="chronos-2").fit(history, time="date", id="store", target=["sales"])
    result = model.forecast(14, quantile_levels=[0.1, 0.5, 0.9])
  3. Read the plan and its range

    The median is the plan. The 10% and 90% columns show a low and a high day to plan stock around.

    plan = result.to_frame()
    print(plan[["id", "timestamp", "median", "q_0.1", "q_0.9"]].head(14))

What you get

A daily plan per storeFourteen days for each store, from one request.
A range for every dayOrder for the middle and keep safety stock for the high end.
Room for what you already knowAdd bank holidays or promotions as known-future columns and the forecast uses them.

Try it

Use Open with to run the forecasting notebook in Colab, Kaggle or Jupyter, or run the code above after pip install "welt-client[parquet]".