FDE Times dataFDE jobs open 913▼15 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 63Companies hiring 200Remote-friendly 24%Median US pay $200kTop hirer Databricks 106
中文VI

The newspaper of the Forward Deployed Engineer

Books & courses

Your model runs without errors. That doesn't mean it works

Made With ML splits tests into code, data and model, and only data tests catch a customer's column that quietly changes type.

ShareLinkedInFacebookX

In brief

  • Made With ML, by Goku Mohandas and now part of Anyscale, teaches how to combine machine learning with software engineering to take ML applications to production.
  • The idea most worth keeping: an ML system can run without errors and still be wrong, so code, data and models all need tests.
  • Accuracy on a held-out set often overestimates a model, so add behavioral tests built on input and output pairs agreed with the client.
Two horizontal bands compare two kinds of test when a column changes from numeric to text while the pipeline keeps running smoothly. The code test (a processing function) misses the error because the code is not wrong. The data test (Great Expectations), highlighted in orange, catches it at once, counting the violating values and giving concrete examples.
In the article's hypothetical example, a source system changes a column from numeric to text. The code test misses the error; the data test catches it at once.

An ML system can run to its last line without raising a single exception or error and still produce wrong results. Made With ML’s lesson on testing uses exactly that as its case for writing tests that go beyond the notebook.

The MLOps course sets out to combine machine learning with software engineering to design, develop, deploy and continuously improve ML applications in production. Its GitHub repository, with about 50.2k stars, describes itself as a course on production-grade ML applications.

For a Forward Deployed Engineer, that covers most of the job. Clients rarely lack a notebook that runs. What they lack is a system that runs correctly, day after day, on real data.

The author is Goku Mohandas. Made With ML now belongs to Anyscale, which is why the site is branded “Made With ML by Anyscale”; the acquisition was announced on July 26, 2023.

A model that runs cleanly can still be wrong

When conventional software breaks, it usually says so. When a model breaks, it keeps returning predictions on schedule, so “it ran without errors” tells you almost nothing.

That is why the course splits testing into three kinds: code, data and models. A hypothetical example shows what each one does. You deploy a model that classifies support requests for a client, and a month later their source system changes a column from numeric codes to text. The pipeline still runs, the model still returns labels, and no warning fires.

Code tests will not catch this, because nothing is wrong with the code. Data tests catch it immediately. The course uses the Great Expectations library, in which each expectation is a verifiable assertion about the data, such as “this column must be an integer.”

The lesson deliberately makes a column-type check fail so learners can see the output. Great Expectations does more than report a failure: it counts the violating values and shows concrete examples. When you work with a client’s data team, those examples are what let you point to what changed in the source system.

High accuracy is not enough for peace of mind

The third layer is model testing, and the course teaches behavioral testing: feed in inputs, check for the expected outputs, and treat the model as a black box.

Researchers have moved in the same direction. The CheckList paper at ACL 2020 argued that accuracy on held-out data often overestimates NLP models, and proposed borrowing behavioral testing from software engineering.

Back to the support-request classifier, a minimal behavioral test might look like this:

# Hypothetical example: input-label pairs agreed with the client
CASES = [
    ("I can't log in", "account"),
    ("This month's invoice was charged twice", "billing"),
]

def test_behavior(model):
    for text, label in CASES:
        assert model.predict([text])[0] == label

The value lies less in these few lines of code than in the conversation that produces the list: which requests the client absolutely cannot accept being misclassified.

On a client site, this is where to start. Before optimizing the model, agree with the client on what “correct” input data looks like and which cases the model must get right, then write both down as tests.

Experiments must be reproducible

The lesson on experiment tracking treats reproducibility as the main benefit of recording experiments: once they are saved, old results are easy to rerun. For an FDE, that value shows up precisely when you move to another project and the client’s engineers need to know why this week’s version beats last week’s.

In the example above, each retraining run should record both its parameters and its behavioral test results, so it is obvious which run made the model fail a critical case.

Nobody can deploy by hand forever

The README says plainly that the course does not deploy manually every time something changes, and automates the process with GitHub Actions instead. For the support-request classifier, a minimal workflow runs all three layers of tests on every push; if any layer fails, the pipeline stops and nothing is deployed.

That lets the client’s team push changes themselves without waiting for you to check each one.

Who should take it, and in what order?

The course suits software engineers who already write Python, know ML at the notebook level and want to move into FDE roles on model-driven products. If you are comfortable with testing and CI but have never put a model into production, it fills exactly that gap.

Take it in this order: experiment tracking first, then testing, then CI/CD, because an automated workflow is only as trustworthy as the test suite beneath it. Do not skip the testing section on the assumption that you already know it: data tests and model tests are what separate people who run ML in production from people who only build demos.

For your career, turn the course into evidence. A repository with three layers of tests, reproducible tracked experiments and a green CI workflow is more persuasive than a line on your CV saying “knows MLOps.” When FDE job ads mention “CI/CD,” “experiment tracking” or “production ML,” that repository is concrete proof of each.

A notebook shows the client that the model can do the job. Three layers of tests tell them the moment it starts getting things wrong, before end users notice.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
9 sources
Read next on the roadmap · Stage 5: DeploymentBuilding Secure and Reliable Systems: the seven chapters FDEs needThe book is free to read online, and seven of its 21 chapters map closely onto the work an FDE does on a client site.