A clean and modern ML microservice for logistic regression (GLM) using FastAPI. This project was built with scalability, explainability, and deployability in mind. Enjoy!
β Click here to watch on YouTube
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 --reloaddocker build -t logistic-api .
docker run -d -p 8000:8000 logistic-apiMade 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! π
