Skip to content

Code for cumulative link models for ordinal regression that support differentiable learning ala PyTorch

License

Notifications You must be signed in to change notification settings

tufts-ml/cumulative-link-models

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cumulative Link Models

Fig. 1: Cumulative link model likelihood depictions with different link functions and scale parameters.

Code for cumulative link models for ordinal regression that support differentiable learning ala TensorFlow and sklearn outlined in the following paper:

Semi-supervised Ordinal Regression via Cumulative Link Models for Predicting In-Hospital Length-of-Stay.
Alexander A. Lobo, Preetish Rath, Micheal C. Hughes
3rd Workshop on Interpretable Machine Learning in Healthcare (IMLH) at International Conference on Machine Learning (ICML)
2023
PDF available: https://openreview.net/forum?id=pDDKtCklZy

Appeared at IMLH 2023.

Contents

  1. Setup
  2. Demo
  3. Experiments
  4. Testing
  5. Future Development
  6. Citing

Setup

Install Anaconda

Follow the instructions here: https://conda.io/projects/conda/en/latest/user-guide/install/index.html

Create environment

conda env create -f environment.yml

Activate environement

conda activate clm

Demo

Diabetes Disease Progression Prediction

This demo creates a simple network model in TensorFlow to predict the progression of diabetes amongst patients.

Fig. 2: Simple CLM network model representation used to predict diabetes ordinal progression category.

The Diabetes dataset from sklearn is used.

The raw target attribute is a real value quantitative measure of the disease progression one year after baseline. A KBinsDiscretizer is used to bin the continuous target data and encode ordinal labels such that each bin contains the same number of data points.

To run the notebook demo:

  1. Navigate to the notebook located at
demo/diabetes_prediction_via_CLMs_tensorflow.ipynb
  1. Set the kernel as the conda environment (refer to Setup above for instructions)
  2. Run the notebook to create, train, and assess the model

Performance Improvement with Cutpoints Learning

This demo shows the comparison of cumulative link model performance with and without learning the cutpoints on 2-dimensional toydata.

To run the notebook demo:

  1. Navigate to the notebook located at
demo/CLM_cutpoint_training.ipynb
  1. Set the kernel as the conda environment (refer to Setup above for instructions)
  2. Run the notebook to create, train, and assess the models

Simple CLM Model Training in sklearn

This demo showcases how to train a CLM model for ordinal regression using sklearn.

To run the notebook demo:

  1. Navigate to the notebook located at
demo/ordinal_regression_via_CLMs_sklearn.ipynb
  1. Set the kernel as the conda environment (refer to Setup above for instructions)
  2. Run the notebook to create, train, and assess the models

Experiments

Testing

Run the following command to conduct unit testing:

pytest

Future Development

This repo provides the CLM model for the following packages:

  • TensorFlow (tensorflow-probability==0.11.0)
  • scikit-learn (sklearn)

We recognize and apologize that the current tensorflow-probability implementation of the class is technically deprecated. However, we encourage users to contribute and refactor the code to work with newer versions of tensorflow-probability!

We are planning future development for the following packages as well:

  • PyTorch
  • JAX

Please stay tuned!

Citing

To cite this repository, please cite the published paper:

@inproceedings{lobo2023semisupervised,
title={Semi-supervised Ordinal Regression via Cumulative Link Models for Predicting In-Hospital Length-of-Stay},
author={Alexander Arjun Lobo and Preetish Rath and Michael C Hughes},
booktitle={ICML 3rd Workshop on Interpretable Machine Learning in Healthcare (IMLH) },
year={2023},
url={https://openreview.net/forum?id=pDDKtCklZy}
}

About

Code for cumulative link models for ordinal regression that support differentiable learning ala PyTorch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages