Hotel reservation cancellation prediction
Predicts whether a hotel booking will be cancelled, trained on GCS data and deployed to Cloud Run.
What it does
Hotel reservation data is pulled from a Google Cloud Storage bucket, split, label-encoded, skew-corrected, balanced with SMOTE and reduced to the top ten Random Forest features. A LightGBM classifier is tuned with RandomizedSearchCV and each run's datasets, parameters, metrics and model are logged to MLflow. Jenkins builds the Flask app image (training runs during the build), pushes it to Google Container Registry and deploys it to Cloud Run.
What was built
- 01
Ingestion downloads Hotel_Reservations.csv from a GCS bucket and writes an 80/20 train-test split.
- 02
Processing label-encodes categoricals, log-transforms columns with skew above 5, applies SMOTE and keeps ten top features.
- 03
LightGBM is tuned with RandomizedSearchCV; accuracy, precision, recall, F1, parameters and artifacts go to MLflow.
- 04
Dockerfile runs the training pipeline at build time, then serves predictions from a Flask form on port 5000.
- 05
Jenkins pipeline clones the repo, builds a virtualenv, pushes the image to GCR and runs gcloud run deploy.
The pipeline, layer by layer
Five layers, one pipeline.
L1Data
- GCS bucket CSV
- Train-test split
L2Processing
- Encoding and skew fix
- SMOTE balancing
- Feature selection
L3Training
- LightGBM randomized search
- MLflow tracking
L4CI/CD
- Jenkins pipeline
- Container Registry
L5Serving
- Flask app on Cloud Run