Skip to content

Latest commit

Β 

History

History
53 lines (37 loc) Β· 2.46 KB

File metadata and controls

53 lines (37 loc) Β· 2.46 KB

Logistic Regression ML Pipeline with FastAPI πŸš€

A clean and modern ML microservice for logistic regression (GLM) using FastAPI. This project was built with scalability, explainability, and deployability in mind. Enjoy!

From Model to Production: Logistic Regression with FastAPI and Docker

β†’ Click here to watch on YouTube

πŸ”§ Project Structure

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

πŸ§ͺ Training

The notebooks/train_model.ipynb trains a simple logistic regression classifier and exports the model.

▢️ Run API

uvicorn app.main:app --reload

🐳 Docker

docker build -t logistic-api .
docker run -d -p 8000:8000 logistic-api

✨ Author

Pierre-Henry Soria

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! πŸ˜‹

@phenrysay GitHub YouTube BlueSky