Lab build

Colorectal cancer survival prediction on Kubeflow

Predicts colorectal cancer patient survival with gradient boosting, tracked in MLflow and run on Kubeflow.

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

What it does

Patient records are label-encoded, chi-squared feature selection keeps the top five features and the data is split and scaled. A Gradient Boosting classifier is trained and accuracy, precision, recall, F1 and ROC-AUC are logged to MLflow with DagsHub as the remote tracking server. A Flask app serves predictions, and the processing and training steps are containerised, pushed to Docker Hub and run as a Kubeflow pipeline on Minikube.

What was built

  1. 01

    Processing label-encodes features, ranks them with SelectKBest and chi2, and keeps the top five.

  2. 02

    GradientBoostingClassifier (100 estimators, depth 3) trains on scaled data; the scaler is saved with joblib.

  3. 03

    MLflow logs accuracy, precision, recall, F1 and ROC-AUC, using DagsHub as the remote tracking store.

  4. 04

    Kubeflow is installed on a local Minikube cluster and the pipeline image is pulled from Docker Hub.

The pipeline, layer by layer

Four layers, one pipeline.

  1. L1Data

    • Patient records CSV
    • Chi-squared selection
  2. L2Training

    • Gradient Boosting model
    • MLflow on DagsHub
  3. L3Orchestration

    • Docker Hub image
    • Kubeflow pipeline
    • Minikube cluster
  4. L4Serving

    • Flask prediction app

Stack

  • scikit-learn
  • pandas
  • MLflow
  • DagsHub
  • Flask
  • Docker
  • Docker Hub
  • Kubeflow Pipelines
  • Kubernetes
  • Minikube

Next lab build · 21 / 46

Australia rain prediction with three CI/CD systems

Predicts next-day rain in Australia with XGBoost, deployable to GKE from GitHub Actions, CircleCI or GitLab.

Previous: Student performance prediction on AWS and Azure

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