A machine learning API that predicts passenger survival on the Titanic using a Random Forest classifier, packaged in Docker and published on Docker Hub so anyone can run it with a single command
Business Context: Taking a trained model off my own computer and turning it into a service that other people and applications can actually use.
In this project I trained a machine learning model from scratch, containerized it, and published it to Docker Hub. The model is trained inside a Jupyter Docker container, then served from a separate, lighter Docker container using FastAPI.
Anyone with Docker can pull the image and get survival predictions for a Titanic passenger through a simple API, without installing Python or any libraries.
Health check that shows whether the model loaded and its accuracy.
Send one passenger's details and get back survived or not, the survival probability, and a confidence level.
Send a list of passengers and get a prediction for each one.
Model type, training date, accuracy, and the features it uses.
The model is trained on Kaggle's Titanic train.csv (891 passengers). The API takes 7 inputs:
docker run -p 8000:8000 vfoster2docker/titanic-survival-apiNote: The full training run with charts is available in the notebook.