Skip to content

waylonli/PARiskRanker

Repository files navigation

PARiskRanker: Learn to Rank Risky Investors

ACM Python License Stars

🔥 Official implementation of our ACM TOIS 2025 paper: “Learn to Rank Risky Investors: A Case Study of Predicting Retail Traders’ Behaviour and Profitability” by Waylon Li and Tiejun Ma.

📄 Paper DOI: 10.1145/3768623

✨ Highlights

  • Profit-Aware Risk Ranker (PA-RiskRanker) reframes risky investor detection as a ranking problem rather than classification.
  • Introduces PA-BCE loss to integrate Profit & Loss (P&L) into LETOR training.
  • Self-Cross-Trader Attention captures both intra-trader and inter-trader dependencies.

🛠️ Setup

conda create -n pariskranker python=3.10
conda activate pariskranker
pip install -r requirements.txt

📂 Data

  1. Download preprocessed data here.
  2. Unzip into the project root. Expected structure:
├── data
│   ├── creditcard
│   │   ├── fold1 / fold2 / fold3
│   │   └── creditcard.csv
│   ├── jobprofit
│   │   ├── fold1 / fold2 / fold3
│   │   └── job_profitability.csv
├── evaluation
│   └── metrics.py
...

📦 Pre-trained Model (Optional)

👉 [TODO: Add link] – Place it in the project root as with the data folder.

🎯 Reproducing Results

Run any of the following to benchmark:

# PARiskRanker
python run_pariskranker.py test \
  --model_group_size 100 --test_group_size 100 \
  --dataset creditcard --fold 1 \
  --strategy binary --loss_fn graph

We also provide scripts for Rankformer, LambdaMART, SOUR, and baselines (classification & anomaly detection). See README sections for full commands.

📊 Final evaluation notebooks: notebook/eval.ipynb

🏋️ Train from Scratch

FOLD=1  # choose from 1,2,3
python run_pariskranker.py train \
  --epochs 200 --batch_size 128 \
  --group_size 100 --dataset creditcard \
  --fold $FOLD --strategy binary --pnl 1 \
  --loss_fn graph

Hyperparameters can be customised via --help.

📈 Citation

If you use this code, please cite:

@article{10.1145/3768623,
  author = {Li, Weixian Waylon and Ma, Tiejun},
  title = {Learn to Rank Risky Investors: A Case Study of Predicting Retail Traders’ Behaviour and Profitability},
  year = {2025},
  issue_date = {January 2026},
  publisher = {Association for Computing Machinery},
  address = {New York, NY, USA},
  volume = {44},
  number = {1},
  issn = {1046-8188},
  url = {https://doi.org/10.1145/3768623},
  doi = {10.1145/3768623},
  journal = {ACM Trans. Inf. Syst.},
  month = nov,
  articleno = {15},
  numpages = {33},
  keywords = {learning to rank, domain-specific application, individual behaviour modelling, risk assessment}
}

🙌 Acknowledgements

This work was conducted at the Artificial Intelligence Applications Institute, School of Informatics, University of Edinburgh.

About

Supporting codes and data for ACM TOIS 2025 paper "Learn to Rank Risky Investors: A Case Study of Predicting Retail Traders’ Behaviour and Profitability"

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors