This repository contains the code to reproduce the experiments presented in the paper "Relational Conformal Prediction for Correlated Time Series".
Authors: Andrea Cini, Alexander Jenkins, Danilo Mandic, Cesare Alippi, Filippo Maria Bianchi
The datasets used in the experiments are provided by the tsl library. The CER-E dataset can be obtained for research purposes following the instructions at this link.
This project uses the Hydra library to handle the configuration of the hyperparameters and the other experimental settings.
The
config directory stores the configuration files used by Hydra to run the experiments.
The folder config/training contains the configs for training the base models, while config/corel contains the configs to train the
To solve all dependencies, we recommend using Anaconda or Miniconda to build an environment using the configuration specified on conda_env.yml by running the command:
conda env create -f conda_env.ymlOnce the environment is created, activate it:
conda activate corelThe script used for the experiments in the paper is in the experiments folder.
The procedure is divided in two steps:
- train the base point predictor;
- train the conformal predictor.
The first step is to train base point predictor and compute the residuals for the calibration/validation set.
This is done by running run_base_model.py.
For example run the following command to train an RNN base predictor on the METR-LA dataset.
The save_outputs flag allows for saving the results that will be used for CP.
python -m experiments.run_base_model config=default model=rnn dataset=la save_outputs=trueThe results will be saved inside the /log folder. For example
logs/base/la/rnn/2025-06-08/12-15-13/
Caution
The name of the folder will change each time you train the point predictor. Take note of the path to perform the next step.
The next step is to train the conformal prediction model (run_corel.py.
Note that here we need to pass the same directory created at the previous step, which contains the residuals of the calibration/validation set.
python -m experiments.run_corel config=default model=corel dataset=la src_dir="./logs/base/la/rnn/2025-06-08/12-15-13/"If you find this code useful please consider citing our paper:
@article{cini2025relational,
title = {{Relational Conformal Prediction for Correlated Time Series}},
author = {Cini, Andrea and Jenkins, Alexander and Mandic, Danilo and Alippi, Cesare and Bianchi, Filippo Maria},
journal = {International Conference on Machine Learning},
year = {2025}
}