# Code for "Non-Asymptotic Analysis of Efficiency in Conformalized Regression"

Please use the following command to install the relavent python packages.
```bash
pip install -r requirements.txt
```
## File structure
```
initial_code/                     // Code before rebuttal
│
├─ real-data-meps/                   // Real-world experiments in the appendix
│   ├─ dataset.py
│   ├─ meps_plot.ipynb               // Plot experiment results
│   ├─ run_experiment_gpu_cmr.py     // CMR experiment on MEPS'19
│   └─ run_experiment_gpu_cqr.py     // CQR experiment on MEPS'20
│
└─ synthetic-data/                   // Synthetic experiments in main text and appendix
    ├─ alpha_regime_plot.ipynb
    ├─ alpha_regime.ipynb            // Figure 5
    ├─ synthetic_plot.ipynb
    └─ synthetic.ipynb               // Figure 3
  
rebuttal_code_datasets/							 // Code during rebuttal
│
├─ real-data/												 // For real-world data experiments in Appendix G.1
│   ├─ data_allocation_plot.ipynb
│   ├─ dataset.py
│   ├─ models_plot.ipynb
│   ├─ optimizers_plot.ipynb
│   ├─ run_experiment_gpu_cmr_original.py
│   ├─ run_experiment_gpu_cmr.py
│   ├─ run_experiment_gpu_cqr_original.py
│   ├─ run_experiment_gpu_cqr.py
│   ├─ visualizae_dataset_distribution.ipynb
│   └─ rebuttal_datasets.zip
│
└─ synthetic-data/									 // For experiments in Appendix G.2
    ├─ synthetic_adamw.ipynb
    ├─ synthetic_compute_eq41_eq42.ipynb
    ├─ synthetic_conv.ipynb
    ├─ synthetic_huber.ipynb
    ├─ synthetic_l1.ipynb
    ├─ synthetic_msgd.ipynb
    ├─ synthetic_plot_adamw.ipynb
    ├─ synthetic_plot_conv.ipynb
    ├─ synthetic_plot_huber.ipynb
    ├─ synthetic_plot_l1.ipynb
    └─ synthetic_plot_msgd.ipynb

```

## How to run the code
For real-world experiments, execute the following command
```
python run_experiment_gpu_cmr.py
python run_experiment_gpu_cqr.py
```
For synthetic results, run the notebooks
`synthetic.ipynb` and `alpha_regime.ipynb`.

The plots are created from the *plot.ipynb in the respective folders.