# EdGCL: Disentangling Social and Cognitive Homophily in Graph-based Educational Recommender Systems

This repository contains the official implementation of our paper "**EdGCL: Disentangling Social and Cognitive Homophily for Educational Recommendation**", accepted by AAAI 2026 Special Track on AI for Social Impact.

EdGCL is a graph-based framework designed to model learning motivations from both social and cognitive perstictives.
![EdGCL](./Framework.png)

## Environments
We provide a `requirements.txt` file to specify all necessary dependencies for reproducibility. The experiments were conducted on `CUDA 12.1.0` and `conda 24.5.0`. The main package versions are as follows:
* python=3.9.1
* scipy=1.13.1
* numpy=2.0.2
* torch=2.4.0+cu121
* tqdm=4.67.1

## Code Structure
```
EdGCL
├── data.zip # datasets
├── model
│   ├── gt_base.py
│   ├── gt_hetero.py
│   ├── model.py
|   ├── tokenizer_base.py
|   ├── tokenizer_hetero.py
|   ├── transformer_layer.py
│   └── utils.py
├── early_stops.py
├── global_utils.py
├── metric.py
├── README.md
└── run.py
```

## Dataset
We provide the datasets to validate the effectiveness of our method. Dataset statistics are summarized as follows:
| Dataset | MOOCCubeX | MOOPer |
| - | - | - |
| Students | 10,893 | 6,057 |
| Resources | 66,891 | 3,784 |
| Social Edges | 3,589,654 | 1,316,667 |
| Social Graph Density | 3.03% | 3.59% |
| Learning Edges | 2,150,392 | 422,602 |
| Learniong Graph Density | 0.29% | 1.63% |
| Avg. Learning Sequence Length | 191 | 68 |

## Train and Test
Please unzip the dataset before running the code.
```
unzip data.zip
```

Then, run the model using the following command.
```
python run_edgcl.py -d mooper -hop 5 -cog_coef 0.05 -lp_coef 0.1 -ssl_coef 1e-4
```