Skip to content
/ CIA Public

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.

Notifications You must be signed in to change notification settings

luo-lorry/CIA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CIA

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.

Introduction

The main repository contains the code for experiments on subsets without overlap, specifically for bike, community, and meps datasets.

Code Structure

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.

Dependencies

The code requires the following dependencies:

  • Python 3.x
  • PyTorch
  • NumPy
  • Pandas
  • Matplotlib
  • Scikit-learn

Running the Code

To run the code, simply execute the main.py file using Python. This will run the experiments on the specified datasets.

Split Conformal Method

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

Conformal Quantile Regression uses the quantile regression forests [2] as the quantile predictor.

Plotting Results

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.

Experiments with GNN for Subsets with Overlaps

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.

Directed Graph Autoencoder

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.

Required Packages

Some required packages include:

  • networkx
  • geopandas
  • pandas
  • numpy
  • matplotlib
  • torch
  • torch_geometric

Implementation

  • DirectedGNN, train_digae, test_digae, train_digae_quantile_regression, and test_digae_quantile_regression are implemented in digae_traffic.py
  • GAE and DirectedEdgeDecoder are implemented in autoencoder.py

Data

Meps Data

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.

Acknowledgments

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

References

[1] Conformal Quantile Regression

[2] Quantile Regression Forests

[3] Conformalized Interval Arithmetic with Symmetric Calibration

About

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.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages