Week 10

Author

Huanfa Chen

Published

March 25, 2026

Introduction

This week will introduce how to conduct various types of testing of code, data, and models in ML systems using Python tools of pytest and great expectations.

Learning Objectives

By the end of this week, you will be able to:

  1. Understand the motivation of moving from notebooks to scripts.
  2. Understand the principle and types of testing in ML systems.
  3. Can use pytest and great expectations to test ML code and data.

Lecture

There are two parts of lecture notes:

  1. MLOps and moving to scripts: Lecture
  2. Testing ML systems: Lecture

Quiz

To access the quiz on Moodle, please check Moodle page.

Practical

Note

To save a copy of notebook to your own GitHub Repo: follow the GitHub link, click on Raw and then Save File As... to save it to your own computer. Make sure to change the extension from .ipynb.txt (which will probably be the default) to .ipynbbefore adding the file to your GitHub repository.

To access the practical:

  1. Preview
  2. Download

Further resources