PredictaCare is a Philly Codefest project (Drexel’s 11th annual “Leveraging AI for the Common Good”) that predicts healthcare appointment durations to help clinics optimize scheduling and reduce patient wait time.
April 2024 – June 2024 • Team: Jeff Torr, Eli Young, Tony Stanell
- Analyzes a short free‑text appointment description plus demographics (age, gender, prior visit) and predicts the estimated visit length (in minutes).
- Supports a simple web UI and an HTTP endpoint for programmatic use.
- Python (scikit‑learn, NLTK, NumPy, SciPy, pandas)
- Node.js + Express for the web/API server
- Static HTML/CSS/JS frontend
- Dockerized runtime for reproducible setup
- License: GPL‑3.0 (see
LICENSE)
nodejs-docker-web-app/: Main app (Node.js server, frontend, Dockerfile, Python model code and CSV dataset)BackEndTerminalTests/: Historic/experimental terminal scripts and models used during exploration
You can run PredictaCare either with Docker (recommended) or locally.
- Open a terminal and navigate to the app folder:
cd nodejs-docker-web-app
- Build the image:
docker build -f dockerfile -t predictacare:latest .
- Run the container:
docker run --rm -p 8080:8080 predictacare:latest
- Open the UI at
http://localhost:8080
Prerequisites: Node 18+, Python 3.9+.
- Install Node dependencies:
cd nodejs-docker-web-app
npm install
- Install Python dependencies:
pip install -r requirements.txt
- On Windows, ensure the app uses the right Python command (set once per shell):
set PYTHON_EXECUTABLE=python
On macOS/Linux (optional; defaults to python3):
export PYTHON_EXECUTABLE=python3
- Start the server:
npm start
- Open
http://localhost:8080
POST /run-python
- Request body (JSON):
{
"descriptionField": "sore throat and fever",
"ageField": 37,
"genderField": "male", // "male" | "female"
"familiarityField": "yes" // "yes" | "no"
}
- Response (JSON):
{ "output": "23.418273" }
Example with curl:
curl -X POST http://localhost:8080/run-python \
-H "Content-Type: application/json" \
-d '{
"descriptionField": "sore throat and fever",
"ageField": 37,
"genderField": "male",
"familiarityField": "yes"
}'
Notes:
outputis the predicted appointment length in minutes (stringified).- The Node server shells out to a Python script which loads/trains a model and returns a prediction.
- Dataset:
EstimateHealthcareAppointmentLengthGivenX-Sheet2.csv - Features:
- Text: appointment description → TF‑IDF (1–2 grams)
- Numeric: age, gender (0/1), familiarity (0/1)
- Model: scikit‑learn Linear Regression trained on TF‑IDF + numeric features (concatenated via SciPy sparse hstack)
- Preprocessing: tokenization, lowercasing, lemmatization, English stopword removal (NLTK)
Training/prediction entry point: nodejs-docker-web-app/SkLearnLinearRegression.py
- The Docker image installs NLTK data at build time to avoid first‑run downloads.
- On Windows, set
PYTHON_EXECUTABLE=pythonbeforenpm startifpython3is not available. - This repository includes earlier terminal‑only experiments in
BackEndTerminalTests/for reference.
PredictaCare is a research/demo project. It is not a medical device and must not be used for diagnosis or treatment decisions.
Built and showcased at Drexel’s 11th annual Philly Codefest: “Leveraging AI for the Common Good.”