Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/characat0/mlops-fundamentals-homework/llms.txt

Use this file to discover all available pages before exploring further.

This homework is the capstone assignment for the MLOps Fundamentals and Practice course. You will build a production-ready, end-to-end MLOps pipeline that classifies Spotify songs into 10 genre categories — Rock, Pop, Electronic, Folk, Country, Hip-Hop, R&B, Jazz, Blues, and Classical — using a dataset of approximately 550,000 tracks. Along the way you will wire together four industry-standard tools — DVC, MLflow, FastAPI, and SciPy-based drift detection — into a single cohesive system that mirrors how real ML teams ship and monitor models.

What You Will Build

The project is organised as a monorepo with three independently runnable subsystems, each targeting a different phase of the ML lifecycle.

DVC Data Pipeline

A four-stage DVC pipeline (load → process → train → evaluate) that ingests the raw Kaggle CSV, performs a temporal split at year 2010, trains two model types (Logistic Regression and XGBoost), and registers the best model in the MLflow Model Registry.

MLflow Experiment Tracking

Every training run logs hyperparameters, accuracy metrics, and model artifacts to a local MLflow tracking server. The evaluate stage automatically promotes the winning run to the @champion alias.

FastAPI Model Serving

A containerised FastAPI application that loads the @champion model at Docker build time, exposes a POST /predict endpoint with Pydantic-validated audio features, and streams every request to a JSONL log file for downstream drift analysis.

KS Drift Monitoring

An offline batch script that applies the Kolmogorov–Smirnov two-sample test to compare the training-data distribution against either the held-out production simulation split or live API request logs, flagging features whose distribution has shifted significantly.

Learning Objectives

By completing this homework you will be able to:
  • Apply temporal data splits to simulate realistic distribution shift between training and production environments.
  • Use MLflow to track experiment parameters, log evaluation metrics, register models, and manage deployment aliases.
  • Write Pydantic v2 schemas to validate incoming requests to a machine-learning API.
  • Package a trained ML model inside a Docker container so the container is fully self-contained at runtime.
  • Implement statistical drift detection using the Kolmogorov–Smirnov test on both batch and online data sources.

Grading at a Glance

The assignment is worth 20 points in total, split across five graded areas.

Data Pipeline

6 points — Temporal split, MLflow-logged training runs for both model types, and champion model registration via the MLflow client API.

Model Serving

5 points — Pydantic feature schema, /health and /predict endpoints, JSONL request logging middleware, and a working Dockerfile that downloads the @champion model at build time.

Drift Monitoring

3 points — KS test loop over all audio features in both batch mode (train vs. prod_sim) and online mode (train vs. API logs), with JSON drift reports as output.

Testing & CI/CD

4 points — Unit tests for the data pipeline, integration tests for the API, flake8 linting, and a green GitHub Actions run on the Pull Request.

Documentation

2 points — All TODO comments resolved, code clearly commented, and a complete submission checklist in the PR description.

Total

20 points — A passing CI run on your Pull Request is worth 1 point on its own — push early and push often.
Ready to submit? See How to Submit for the exact fork → branch → PR steps and the full submission checklist.

Build docs developers (and LLMs) love