This project demonstrates an end-to-end Machine Learning Operations (MLOps) workflow, where a predictive model is trained, containerized, and deployed as a production-ready REST API.
The system predicts whether a bank customer is likely to subscribe to a term deposit based on marketing campaign data, enabling more targeted and efficient outreach.
- Built a complete ML pipeline from data preparation to model inference
- Developed a REST API for real-time predictions using Flask
- Containerized the application using Docker for portability and consistency
- Deployed and tested the service on cloud infrastructure (AWS EC2)
Bank marketing campaigns often experience low conversion rates due to broad, untargeted outreach.
This project addresses the problem by predicting customer subscription likelihood, allowing marketing teams to prioritize high-probability leads and reduce ineffective contact attempts.
This project focuses on model deployment and inference. Continuous retraining, CI/CD, and monitoring are outside the current scope but can be logical next steps.
- Model: K-Nearest Neighbors (KNN)
- Dataset: UCI Bank Marketing Dataset
- Preprocessing:
- Feature engineering
- Categorical variable encoding
- Numerical feature scaling
- Inference Output:
- Binary prediction (Subscribe / Not Subscribe)
- Class-level probability scores
High-level flow:
- Raw marketing data is processed using a preprocessing pipeline
- The trained model and pipeline are serialized for inference
- A Flask-based API serves predictions
- The application is containerized using Docker
- The container is deployed on AWS EC2 for external access
- Python
- scikit-learn
- Flask
- Docker & Docker Compose
- AWS EC2
ML_Ops.ipynb– Model training, feature engineering, and evaluationML_Ops_App.ipynb– Inference logic and API integrationDockerfile– Container build configurationrequirements.txt– Python dependenciesdeployment-process.md– Detailed deployment steps and execution logs
curl http://<EC2_PUBLIC_IP>:5000/curl -X POST \
-H "Content-Type: application/json" \
-d @sample.json \
http://<EC2_PUBLIC_IP>:5000/predict{
"prediction": 0,
"prediction_proba_no": 0.91,
"prediction_proba_yes": 0.09
}Detailed cloud setup, Docker commands, and validation steps are documented in deployment-process.md.
This repository emphasizes production-oriented machine learning practices, focusing on deployment readiness, reproducibility, and real-world decision support rather than model benchmarking alone.
