https://github.com/ph-7/python-glm-ml-pipeline
ML Python - Logistic Regression (GLM)
https://github.com/ph-7/python-glm-ml-pipeline
glm glm-python logistic-regression ml-api scikit-learn scikit-learn-python scikitlearn-machine-learning
Last synced: 14 days ago
JSON representation
ML Python - Logistic Regression (GLM)
- Host: GitHub
- URL: https://github.com/ph-7/python-glm-ml-pipeline
- Owner: pH-7
- License: mit
- Created: 2025-07-29T10:14:39.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-10-15T08:20:22.000Z (8 months ago)
- Last Synced: 2025-10-15T22:57:42.154Z (8 months ago)
- Topics: glm, glm-python, logistic-regression, ml-api, scikit-learn, scikit-learn-python, scikitlearn-machine-learning
- Language: Python
- Homepage: https://github.com/pH-7/PythonGMLMLPipeline
- Size: 17.6 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# 🚀 ML Python Pipeline: Logistic Regression (GLM)
[](https://www.youtube.com/watch?v=K5_O-kSyiyg)
_**[→ Watch it directly on YouTube](https://www.youtube.com/watch?v=K5_O-kSyiyg)**_
**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
## 📂 Project Structure
```plaintext
.
├── app/ # FastAPI application
├── train/ # Training scripts
├── assets/images/ # Images, diagrams
├── requirements.txt # Python dependencies
├── Dockerfile
├── .env.dist # Sample environment variables
├── LICENSE.md
└── README.md
```
## 🔋 Run Locally
1. Clone the repository:
```bash
git clone https://github.com/your-username/Python_GML_MLPipeline.git
cd Python_GML_MLPipeline
```
2. Create and activate a virtual environment:
```bash
python -m venv venv
source venv/bin/activate
```
3. Install dependencies:
```bash
pip install -r requirements.txt
```
4. Copy `.env.dist` to `.env` and configure your environment variables:
```env
PORT=8000
MODEL_PATH=train/model.pkl
```
5. Train the model:
```bash
cd train/
python train_model.py
cd ..
```
6. Start the server:
```bash
uvicorn app.main:app --reload --port $PORT
```
## 🐟 Docker
1. Build the Docker image:
```bash
docker build -t ml-api .
```
2. Run the container:
```bash
docker run --env-file .env -p 8000:8000 ml-api
```
Visit `http://127.0.0.1:8000/docs` for Swagger UI.
## 👋 Author
[](https://ph7.me "Pierre-Henry Soria, Software Developer")
Made with ❤️ by **[Pierre-Henry Soria](https://pierrehenry.be)**. A super passionate & enthusiastic Problem-Solver / Senior Software Engineer. Also a true cheese 🧀, ristretto ☕️, and dark chocolate lover! 😋
[](https://x.com/phenrysay "Follow Me on X") [](https://github.com/pH-7 "My GitHub") [](https://www.youtube.com/@pH7Programming/videos "My YouTube Tech Engineering Channel") [](https://bsky.app/profile/pierrehenry.dev "Follow Me on BlueSky")
## 📄 License
Distributed under the [MIT License](LICENSE.md) 🎉 Happy hacking! 🤠