Name: Shubham Verma
Roll Number: G24AI1002
Course: MLOps
Instructor: Dr. Pratik Mazumder
This repository implements a complete MLOps pipeline using LinearRegression from scikit-learn on the California Housing dataset. It includes:
- Model training
- Manual quantization (8-bit)
- Inference and evaluation
- Docker containerization
- CI/CD integration with GitHub Actions
- Automated testing
.
├── src/
│ ├── train.py # Train Linear Regression model
│ ├── quantize.py # Quantize model coefficients
│ ├── predict.py # Make predictions
│ └── utils.py # Shared functions
├── tests/
│ └── test_train.py # Unit tests using pytest
├── .github/
│ └── workflows/
│ └── ci.yml # GitHub Actions workflow
├── model.joblib # Pretrained model (generated via train.py)
├── requirements.txt # Project dependencies
├── Dockerfile # Container setup
├── .gitignore # Ignore cache/artifact files
└── README.md # Project documentation
python -m venv venv
venv\Scripts\activate # On Windows
pip install -r requirements.txtpython src/train.pypython src/quantize.pypython src/predict.pypytestdocker build -t housing_model .
docker run --rm housing_modelGitHub Actions runs on every push to main, consisting of:
- ✅
test suite: runs unit tests usingpytest - ✅
train and quantize: trains model and performs quantization - ✅
build and test container: builds Docker image and verifies predictions
All jobs must pass for the workflow to succeed.
- R2 Score & MSE
- Sample Vs Actual Prediction
- Only
LinearRegressionis used. - No hardcoded values.
- Code is modularized and organized.
- Only the
mainbranch exists. - CI/CD is implemented using GitHub Actions.