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.
Follow the instructions here: https://conda.io/projects/conda/en/latest/user-guide/install/index.html
conda env create -f environment.yml
conda activate clm
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:
- Navigate to the notebook located at
demo/diabetes_prediction_via_CLMs_tensorflow.ipynb
- Set the kernel as the conda environment (refer to Setup above for instructions)
- Run the notebook to create, train, and assess the model
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:
- Navigate to the notebook located at
demo/CLM_cutpoint_training.ipynb
- Set the kernel as the conda environment (refer to Setup above for instructions)
- Run the notebook to create, train, and assess the models
This demo showcases how to train a CLM model for ordinal regression using sklearn.
To run the notebook demo:
- Navigate to the notebook located at
demo/ordinal_regression_via_CLMs_sklearn.ipynb
- Set the kernel as the conda environment (refer to Setup above for instructions)
- Run the notebook to create, train, and assess the models
Run the following command to conduct unit testing:
pytest
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!
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}
}