Skip to content

Examples

Each example is a forecasting job on real public data, from the first model to a decision, with TimeGym in the loop: what we tried first, what TimeGym showed, and what we changed. The numbers are what came out when the notebook ran, including the places where the plan we started with did not hold.

A tutorial explains one tool. An example shows a job done, and links to the tutorials for the tools it uses.

Run an example yourself

The notebooks are in the repository's examples/ folder, not in the installed package. From a clone:

git clone https://github.com/diogoseca/timegym.git
cd timegym
python -m pip install -e '.[examples]'
python -m jupyterlab examples

Every example reads a small sample of its data that is committed in the repository, so it runs offline. Select the Python kernel of the environment you installed into, and use Restart Kernel and Run All Cells.

One example also reads forecasts that a large pretrained model made in advance. Saved forecasts says what they are and how to make them again.

The data

Each dataset is public and comes with a license that allows sharing it with credit. Example data lists, for each one, the source, the license, the credit line, what we changed and the checksums.

The committed samples are small: from a few hundred rows to one year of half-hours, or a few dozen products. To work with a whole dataset, ask the loader for it. It downloads the source once, checks it against the recorded checksum and keeps a copy on your computer:

from example_data import load

sample = load("store-sales")                  # 30 products, committed in the repository
everything = load("store-sales", full=True)   # every product, downloaded on first use