# IM-Context
Code for the IM-Context: In-Context Learning for Imbalanced Regression Tasks paper. 

## Prerequisites
- Python3
- Numpy
- PyTorch
- Transformers
- PIL
- scikit-learn

Please create and activate the following conda envrionment.

```python
# It may take several minutes for conda to solve the environment
conda update conda
conda env create -f environment.yml
conda activate in-context-learning 
```

## Test and benchmark IM-Context model

In side code, a jupyter notebook 'Benchmark_all_tabular.ipynb' can be run to compare the different sklearn methods and the in-context learning apparoach. 

For the GPT2 model, please download it from this repository: https://github.com/dtsip/in-context-learning?tab=readme-ov-file