Drug Classification
A machine learning pipeline that predicts a patient's drug prescription from their medical profile, trained, evaluated, serialized and served end to end, so the model answering requests is always the one the published numbers describe.
A classification pipeline that predicts a drug prescription (one of five classes) from a patient's medical profile: age, sex, blood pressure, cholesterol and sodium-to-potassium ratio. It reaches 95% accuracy and an 0.86 F1 score on the held-out test set, with only a handful of confusions between the closer drug classes. This is a small dataset and a solved problem, so the shape is worth more than the score.
The trained pipeline is serialized with skops and served through a FastAPI '/predict' endpoint. Choosing skops over raw pickle is a small decision with a real reason: loading a pickle executes arbitrary code, which is an unacceptable property for an artifact meant to be shared. GitHub Actions automates training and evaluation and regenerates the metrics and confusion matrix on every run, which is what keeps the served model and the published numbers the same model.
The confusion matrix is published alongside the accuracy on purpose. Clinical decision support is the wrong setting for 95% to sound like enough, and which classes get confused with which matters more here than the headline figure.
- Trained a classifier on patient records (age, sex, blood pressure, cholesterol, sodium-to-potassium ratio) reaching 95% accuracy and an 0.86 F1 score
- Served predictions through a FastAPI '/predict' endpoint, with the model serialized via skops rather than raw pickle
- Automated training and evaluation through GitHub Actions, regenerating metrics and a confusion matrix on every run
- 12
- Not recently updated