A clean and modern ML microservice for logistic regression (GLM) using FastAPI. This project was built with scalability, explainability, and deployability in mind. Enjoy!
logistic-regression-fastapi/
│
├── app/
│ ├── main.py # FastAPI app entrypoint
│ ├── model.py # Model loading and prediction logic
│ └── schemas.py # Pydantic request/response models
│
├── models/
│ └── logistic_model.joblib # Pretrained logistic regression model
│
├── notebooks/
│ └── train_model.ipynb # Jupyter notebook for training and evaluation
│
├── Dockerfile # Containerisation setup
└── requirements.txt # Python dependencies
The notebooks/train_model.ipynb
trains a simple logistic regression classifier and exports the model.
uvicorn app.main:app --reload
docker build -t logistic-api .
docker run -d -p 8000:8000 logistic-api
Made with ❤️ by Pierre-Henry Soria — an AI Data Scientist & Senior Software Engineer. Incredibly passionate about AI, machine learning, data science, and emerging technologies. I could happily talk all night about programming and IT with anyone who’s keen. Roquefort 🧀, ristretto ☕️, and dark chocolate lover! 😋