Skip to content

pH-7/Python-GLM-ML-Pipeline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 ML Python Pipeline: Logistic Regression (GLM)

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

.
├── 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:
git clone https://github.com/your-username/Python_GML_MLPipeline.git
cd Python_GML_MLPipeline
  1. Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate
  1. Install dependencies:
pip install -r requirements.txt
  1. Copy .env.dist to .env and configure your environment variables:
PORT=8000
MODEL_PATH=train/model.pkl
  1. Train the model:
cd train/
python train_model.py
cd ..
  1. Start the server:
uvicorn app.main:app --reload --port $PORT

🐟 Docker

  1. Build the Docker image:
docker build -t ml-api .
  1. Run the container:
docker run --env-file .env -p 8000:8000 ml-api

Visit http://127.0.0.1:8000/docs for Swagger UI.

👋 Author

Pierre-Henry Soria

Made with ❤️ by Pierre-Henry Soria. A super passionate & enthusiastic Problem-Solver / Senior Software Engineer. Also a true cheese 🧀, ristretto ☕️, and dark chocolate lover! 😋

@phenrysay pH-7 YouTube Tech Videos BlueSky

📄 License

Distributed under the MIT License 🎉 Happy hacking! 🤠