Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Personalized Warfarin Dosage Recomender

A machine learning web app built with scikit-learn and Streamlit that predicts personalized therapeutic doses of Warfarin (a common blood thinner) based on clinical, demographic, and lifestyle data.

Purpose

Warfarin is one of the most widely prescribed anticoagulant medications, and is used to prevent blood clots in patients with conditions such as

  • Atrial fibrillation (irregular heartbeat)
  • Deep vein thrombosis
  • Pulmonary embolism
  • Mechanical heart valves

However, Warfarin has a very narrow therupeutic window. The correct dose for one patient can cause serious bleeding in another, or be completely ineffective, leading to life-threatening clots. Traditional Warfarin dosing methods use standard clinical guidelines or harmful trial-and-error adjustments. However, machine learning offers the potential to personalize dosing using patterns learned from large patient datasets.

Overview

This app uses a trained Random Forest Regressor to provide data-driven dose estimates, helping show how AI can assist with peronalized medicine. It uses more than 29 patient features, preprocessing with scaling, encoding, and imputation, and saves/loads the movel using joblib. A graphical user interface is provided to the user through streamlit

Demo

Demo Screenshot


Features

  • Intelligent preprocessing: handles missing data, encodes categorical values, scales numerics
  • Predicts Warfarin dose in mg/week
  • Built-in model training & evaluation (MAE, RMSE, R²)
  • Easy-to-use Streamlit interface for clinicians or patients

🛠️ Installation

1. Clone this repo

git clone https://github.com/cybergeist0/personalized-warfarin.git
cd personalized-warfarin

2. Set up Python environment

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

3. Install dependencies

pip install -r requirements.txt

4. Run the app

# Ensure `warfarin_data.xls` is in the `data/` folder
python3 ./main.py # On Windows: python main.py
streamlit run app.py

About

a Machine learning project using Random Forest Regression to provide personalized Warfarin doses based on clinical and lab data

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages