Lab build

Wine quality modular ML pipeline

Config-driven pipeline that ingests, validates, transforms and trains an ElasticNet wine quality model.

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

What it does

Config, schema and params YAML files drive five stages: download and unzip the wine quality data, validate columns against the schema, split the data, train ElasticNet and evaluate it. Evaluation logs parameters plus RMSE, MAE and R² to MLflow, with DagsHub available as a remote, and a Flask app exposes training and prediction routes.

What was built

  1. 01

    Ingestion downloads winequality-data.zip from a configured URL and extracts winequality-red.csv.

  2. 02

    Validation compares every column against schema.yaml and writes a status file.

  3. 03

    ElasticNet (alpha 0.2, l1_ratio 0.1 from params.yaml) is trained and saved with joblib.

  4. 04

    Evaluation logs parameters, RMSE, MAE and R² to MLflow and writes metrics.json.

  5. 05

    Flask /train reruns the pipeline and /predict returns predicted quality from a form.

The pipeline, layer by layer

Five layers, one pipeline.

  1. L1Config

    • config, schema, params YAML
  2. L2Pipeline

    • Ingestion
    • Validation
    • Transformation
  3. L3Training

    • ElasticNet training
  4. L4Evaluation

    • MLflow metrics
  5. L5Serving

    • Flask app

Stack

  • scikit-learn
  • pandas
  • MLflow
  • DagsHub
  • Flask
  • PyYAML
  • python-box
  • joblib
  • Docker

Next lab build · 26 / 46

MovieLens recommender evaluation framework

Framework that trains and compares recommender algorithms on MovieLens with accuracy and top-N metrics.

Previous: Keras CNN training and tuning on SageMaker

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