liveBook · Manning

Versioning

As explained in Machine Learning System Design

Model versioning is the practice of assigning and managing distinct identifiers for machine learning model revisions.

A model update can change a system’s behavior even when its API looks unchanged. Model versioning assigns distinct identifiers to revisions and lets a caller request a specific version during initialization. Updating a model without changing its version can silently change results. section 13.1

Listing 13.3 Adding a model version to the API
class Model:
    def __init__(self, version):
        self.version = version
        self.model = load_model(version)

    def predict(self, features, time=None, seed=42):
        if time is None:
            time = datetime.now()
        return self.model.predict(features, time, seed)

The model is loaded using the version requested when the object is initialized. section 13.1

Versioning the model alone may not preserve compatibility. Changes to input or output data, preprocessing, postprocessing, or dependencies can also change results. Even a Python version update can produce different outputs while everything else stays fixed. section 13.1

Features need versioning too. If a feature’s calculation or data source changes, values calculated before and after the update may differ and should not be mixed. Treating every update as a new feature avoids ambiguity but can clutter the code with near-duplicates. section 11.4.2

To support reproducibility and safer updates:

  • Record feature versions in dataset metadata alongside the features and timestamp range. section 11.4.2
  • When a feature changes, overwrite it or write the new version to a separate table and backfill available history. section 11.4.2
  • Reflect breaking model changes in the version, and check the rest of the pipeline for compatibility changes. section 13.1

How Machine Learning System Design covers it

How deep it goes
Explains compatibility risks and feature-version metadata, while deferring advanced model registry solutions.
Examples
Uses a version-selecting model initializer, changed feature calculations, and a Python update that altered outputs.
What you can do after
Operate/configure model version selection and record feature versions to support reproducibility and compatibility.
How it connects
Connects model versioning with API compatibility, feature stores, dataset reproducibility, and model registries.

Also explained in

Compare how 27 books explain versioning →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Machine Learning System Design. The section links point to the parts of the book it draws on.