Sources for CS234 Project - Estimation of the Warfarin Dose.
/data- contains provided warfarin.csv dataset and support files- appx.pdf: appendix file providing the context
- metadata.xls: meta data describing the columns of the data set
- warfarin.csv: original dataset with 5700 patient records
results- where run results and plots are storedclinical_dose.py- subclass ofRecommenderwith implementation of Warfarin Clinical Dosing Algorithmconfig.py- configuration classes for algorithms.constant.py- define constants.ensemble_majority3.py- subclass ofRecommederwith implementation of majority vote ensemble algorithmevaluation.py- utilities for evaluating algorithms.feature.py- define all enums for featuresfixed_dose.py- subclass ofRecommenderwith implementation of fixed dose algorithmlasso_bandit.py- subclass ofRecommederwith implementation of Lasso bandit algorithmlin_ucb.py- subclass ofRecommenderwith implementation of LinUCB algorithm (disjoint).patient.py- encapsulate all info about a patientplotting.ipynb- jupyter notebook to generate plots from a result set from a previous runpreprocess.py- handles all pre-processing of the patient datarecommender.py- abstractRecommenderclass to represent a recommendation modelrequirements.txt- for installing required librariestree_heuristic.py- subclass ofRecommenderwith implementation of DTree algorithm.util.py- utilities to load and preprocess warfarin datasetwarfarin.py- themainprogram to run Warfarin dosage recommendations
python warfarin.py --algo=[algo_names] --iter=[iterations] --train_ratio=[training set ratio]
[algo_names]:allfor running all models OR one offixed_dose,clinical_dose,linucb_disjoint. Default isfixed_dose.[iterations]: Number of iterations to run the experiments through the entire data set. Each iteration will run on a randomly shuffled permutation of the dataset. Default is1for single iteration.[training set ratio]: Ratio of the data set used for training. The rest of the data set is used for test set. Default is0.8for an 80-20 training/testing split.
- Run Fixed Dose recommendation (baseline 1) for 1 (default) iteration with 80/20 (default) training/testing split:
$ python warfarin.py --algo=fixed_dose
- Run Warfarin Clinical Dosing Algorithm recommendation (baseline 2) for 5 iterations with 80/20 (default) training/testing split::
$ python warfarin.py --algo=clinical_dose --iter=5
- Run LinUCB Disjoint recommendation for 1 (default) iteration with 50/50 training/testing split:
$ python warfarin.py --algo=linucb_disjoint --train_ratio=.5
- Run ALL models for 10 iterations with 70/30 training/testing split:
$ python warfarin.py --algo=all --iter=10 --train_ratio=0.7
jupyter notebook
- Launch Jupyter notebook
- open
plotting.ipynband run the cells