This project transforms a trained Machine Learning model into a professional, scalable web service. By wrapping the model in a FastAPI framework and containerizing it with Docker, we ensure the model works consistently across any environment.
- Languages: Python
- Libraries: FastAPI, Pydantic, Scikit-Learn, Pandas, Uvicorn
- DevOps: Docker
- Backend: FastAPI (Python)
- Model: Random Forest Classifier (Previous Project logic)
- Containerization: Docker (Python 3.10-slim)
- Documentation: Automatic OpenAPI/Swagger UI
The churn_model.pkl used in this microservice was developed in my previous Churn Analysis Project. In that project, I performed extensive Exploratory Data Analysis (EDA) and trained a Random Forest Classifier to identify patterns in customer behavior. This project focuses on the deployment phase of that model's lifecycle.
Below is a real-time prediction captured from the interactive Swagger UI. The API successfully processes a "passenger" profile and returns a churn status in milliseconds.
docker build -t churn-api .
docker run -p 8000:8000 churn-api
Navigate to http://localhost:8000/docs in your browser. Use the POST /predict endpoint.
