Lab build

Hotel reservation cancellation prediction

Predicts whether a hotel booking will be cancelled, trained on GCS data and deployed to Cloud Run.

Role
Builder, end to end
Group
MLOps
Services
AI & LLM systems · MLOps & cloud

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

  1. 01

    Ingestion downloads Hotel_Reservations.csv from a GCS bucket and writes an 80/20 train-test split.

  2. 02

    Processing label-encodes categoricals, log-transforms columns with skew above 5, applies SMOTE and keeps ten top features.

  3. 03

    LightGBM is tuned with RandomizedSearchCV; accuracy, precision, recall, F1, parameters and artifacts go to MLflow.

  4. 04

    Dockerfile runs the training pipeline at build time, then serves predictions from a Flask form on port 5000.

  5. 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.

  1. L1Data

    • GCS bucket CSV
    • Train-test split
  2. L2Processing

    • Encoding and skew fix
    • SMOTE balancing
    • Feature selection
  3. L3Training

    • LightGBM randomized search
    • MLflow tracking
  4. L4CI/CD

    • Jenkins pipeline
    • Container Registry
  5. L5Serving

    • Flask app on Cloud Run

Stack

  • pandas
  • scikit-learn
  • imbalanced-learn
  • LightGBM
  • MLflow
  • Google Cloud Storage
  • Flask
  • Docker
  • Jenkins
  • Google Container Registry
  • Cloud Run

Next lab build · 14 / 46

Hybrid anime recommender

Blends collaborative and content-based anime recommendations from trained embeddings, deployed to GKE via Jenkins.

Previous: PDF RAG app on NVIDIA NIM

Need a system like this in production? Tell us about it.