ML API that predicts binary classes using scikit-learn and FastAPI.
- Model trained on breast cancer dataset
- REST API with FastAPI - real-time requests
- Docker support
- Environment variable configuration
- Citable research-ready API
- MIT Licensed
.
├── app/ # FastAPI application
├── train/ # Training scripts
├── assets/images/ # Images, diagrams
├── requirements.txt # Python dependencies
├── Dockerfile
├── .env.dist # Sample environment variables
├── LICENSE.md
└── README.md
- Clone the repository:
git clone https://github.com/your-username/Python_GML_MLPipeline.git
cd Python_GML_MLPipeline
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Copy
.env.dist
to.env
and configure your environment variables:
PORT=8000
MODEL_PATH=train/model.pkl
- Train the model:
cd train/
python train_model.py
cd ..
- Start the server:
uvicorn app.main:app --reload --port $PORT
- Build the Docker image:
docker build -t ml-api .
- Run the container:
docker run --env-file .env -p 8000:8000 ml-api
Visit http://127.0.0.1:8000/docs
for Swagger UI.
Made with ❤️ by Pierre-Henry Soria. A super passionate & enthusiastic Problem-Solver / Senior Software Engineer. Also a true cheese 🧀, ristretto ☕️, and dark chocolate lover! 😋
Distributed under the MIT License 🎉 Happy hacking! 🤠