How breaseabrol/houseprice-api works
This repository provides a housing-price prediction API and its model-training workflow. The training notebook prepares data, engineers features, trains and validates an XGBoost model, then saves model and scaler artifacts; the API loads those artifacts, validates requests, engineers inference features, and returns predictions. README documents Docker, Kubernetes, and Cloud Run deployment paths. Runtime behavior is evidenced by the excerpted main.py; training and deployment connections are documented in the README, since their implementation files were not sampled.
Main entry points: main.py Prediction endpoint · Project.ipynb Training workflow · Dockerfile Docker image · deployment.yaml Kubernetes deployment
Components 17
Model training
- Housing data
data/Housing.csv - Training workflow
Project.ipynb - Data preprocessing
Project.ipynb - Feature engineering
Project.ipynb - Model training
Project.ipynb - Model artifacts
Prediction API
- Prediction endpoint
main.py - Request validation
main.py - Inference features
main.py - Model inference
main.py - Prediction response
main.py
Deployment
- Docker image
Dockerfile - Kubernetes deployment
deployment.yaml - LoadBalancer service
service.yaml - Cloud Run
- Artifact Registry
Other components
- API client
Connections 15
- Housing data → Training workflow: loads data
README.md - Training workflow → Data preprocessing: performs
README.md - Training workflow → Feature engineering: performs
README.md - Training workflow → Model training: trains and validates
README.md - Training workflow → Model artifacts: serializes
README.md - API client → Prediction endpoint: sends request
README.md - Prediction endpoint → Request validation: validates
main.py - Prediction endpoint → Inference features: engineers features
main.py - Prediction endpoint → Model inference: calls predict
main.py - Model artifacts → Prediction endpoint: loaded at startup
main.py - Prediction endpoint → Prediction response: returns prediction
main.py - Docker image → Kubernetes deployment: deploys image
README.md - Kubernetes deployment → LoadBalancer service: exposes service
README.md - Docker image → Artifact Registry: pushes image
README.md - Artifact Registry → Cloud Run: deploys image
README.md