This repo contains code implementation for Conformalized Interval Arithmetic (CIA), which extends Conformal Prediction's coverage guarantees to the arithmetic operations of variables, such as summation.
The main repository contains the code for experiments on subsets without overlap, specifically for bike, community, and meps datasets.
The code is organized into two main files:
main.py
: Contains the code for running experiments on the bike, community, and meps datasets.plot_results.py
: Used to plot the results presented in the main text and appendix of the paper.
The code requires the following dependencies:
- Python 3.x
- PyTorch
- NumPy
- Pandas
- Matplotlib
- Scikit-learn
To run the code, simply execute the main.py
file using Python. This will run the experiments on the specified datasets.
The Split Conformal Method uses a neural network as the base conditional mean predictor. The network consists of three fully connected layers with a hidden dimension of 64. This setting is based on the work of [1].
Conformal Quantile Regression uses the quantile regression forests [2] as the quantile predictor.
The plot_results.py
file is used to plot the results presented in the main text and appendix of the paper. This file takes the output of the main.py
file as input and generates the plots.
The folder gnn
contains code and data for experiments for subsets with overlaps, specifically the road traffic in Anaheim and Chicago. Run main_gnn.py
to run the experiments.
The files digae_traffic.py
and autoencoder.py
contain code that implements a directed graph autoencoder that predicts edge weights based on node (and edge) features.
Some required packages include:
networkx
geopandas
pandas
numpy
matplotlib
torch
torch_geometric
DirectedGNN
,train_digae
,test_digae
,train_digae_quantile_regression
, andtest_digae_quantile_regression
are implemented indigae_traffic.py
GAE
andDirectedEdgeDecoder
are implemented inautoencoder.py
Due to copyright/usage rules, The Medical Expenditure Panel Survey (MPES) data can be downloaded following the instructions in https://github.com/yromano/cqr/blob/master/get_meps_data/README.md.
Please put the downloaded and processed .csv files in the \common\datasets
folder.
We thank the following GitHub repositories for their code:
- CQR: For the implementation of the Split Conformal Method
- QRF: For the implementation of Quantile Regression Forests
- GNN: For the processing of road traffic datasets
- CF-GNN: For the implementation of conformalized graph neural network
[1] Conformal Quantile Regression
[2] Quantile Regression Forests
[3] Conformalized Interval Arithmetic with Symmetric Calibration