Skip to content

Registering a model, and what a version keeps

Turn a finished run into a version that keeps its files, data, scores and reproducibility check. Then use stages and aliases so your work never names a version number.

Applied ~11 min10 steps

You will be able to

  • List what a registered version keeps, and what can still change
  • Read the reproducibility check before you trust a version
  • Use stages and aliases, so that rolling back means moving a pointer
  • Write the intended-use section of a model card
01

A good score isn't a model yet

Read

A row on a leaderboard tells you that a run scored well. It doesn't tell a colleague next year which preprocessing it used, or let them score a new table.

Registering turns a finished run into a model versionModel registryThe record of every model version with its files, data, code, scores and stage, so you can tell what is in use.: a folder that keeps everything needed to use and question it.

FileWhat it keeps
The model file and design.jsonThe fitted model and its fitted preprocessing
manifest.jsonMethod, engine and package versions, scores, split plan, and a checksum of every file
reference_profile.json, reference_sample.parquetThe training rows, summarized and sampled, for drift checks
A model cardA readable summary, in Markdown and JSON
02

What happens when the data changes?

Predict

Predict first

You register a version today. Next week you fix an error in the training data. What happens to that version?

The version updates itselfThe version stays exactly as it wasThe version is deleted
Reveal

It stays as it was. Its fitted files don't change, which is the point: you can always ask what produced a score. To learn from the fixed data, you train again and register a new version. A version's stage, aliases and intended-use text can still change, because they describe how you use the model and not what it is.

03

Register one

In the app

Train a model (the walkthrough's model predicts {{target}}), open it from the leaderboard, and press Register. This walkthrough takes you through it, and on to scoring, drift and a monitor. You can stop after registering and come back.

Then open Models in the sidebar and find your version in the table.

04

Does the saved model behave like the trained one?

Read

A model that scores differently after saving is a bug you want to find now. So registration re-scores the training input through the saved files, and compares the test rows with the predictions the run made.

The version table shows the answer in the Scoring column:

BadgeMeaning
Reproduces exactly / ReproducesThe saved files give the run's predictions
Not checkedThe check was skipped; there's no evidence either way
Differs / Check failedDon't use this version until you know why
05

Two scores, and which to believe

Explore

The table also lists CV and Test. CV is the mean across folds on the training rows, and Test is the score on the locked hold-out.

DExplorable · Cross-validation folds

Which rows should be held out so the score predicts real performance?

Each scheme has a tempting shortcut: training error, plain random folds, or the best score from a search. Will the shortcut here look better than the true error on new data?

How sure?

Scheme

5
40
Simulating…

Commit your prediction above to see the result

Make your prediction first; the figure appears when you commit.

Make your prediction to see the result.

Try each scheme and compare its tempting shortcut with the true error on new data. When a version's CV and Test disagree badly, ask whether its folds matched how the data really arrives.

06

Stages say where it is; aliases say what it's for

Read

A stage records where a version is in its life: Draft, Candidate, Approved, Deprecated or Archived.

An alias names a job: championChampion modelThe version currently trusted for real use; a challenger is one being compared with it, a shadow scores without acting., challenger or shadow. Each alias points at one version at a time. A monitor or endpoint that follows champion moves with it, so nothing else needs to change when you promote.

This also makes rollback one step: point champion back at the previous version.

07

Write the part only you know

Reflect

The Model card tab is generated from the manifest: details, training data, scores, reproducibility and caveats. It can't know what the model is for.

Think of a model you know. Write three sentences for its intended use:

  1. What the model is for.
  2. Who uses its predictions.
  3. Which decisions it must not drive.

The third sentence is the one people skip, and it's the one that prevents misuse.

08

Check your understanding

Checkpoint

Check yourself

A new version's Scoring column says Differs. What should you do?

Show the answer

Answer: b

The scores on the page came from the run. If the saved files behave differently, those scores don't describe what you'd deploy.

Check yourself

A nightly job scores data with "version 7". You promote version 8. What's the better setup?

Show the answer

Answer: a

Aliases separate "which model" from "what it's used for". Versions don't change, so overwriting one would destroy the record you rely on.

Check yourself · choose all that apply

Which of these can change after a version is registered?

Show the answer

Answer: a, b, c

Stage, aliases and intended use describe how you use the version. The fitted files describe what it is, so they stay fixed, and the manifest records a checksum for each one.

09

Check a version's files yourself

In the app

On a version's Overview tab, press Show in Finder to open its folder. The manifest lists every file with its SHA-256 checksum, so you can confirm that nothing has been altered.

Python
import hashlib
import json
from pathlib import Path

folder = Path("models/churn/3")  # <project>/models/<name>/<version>
manifest = json.loads((folder / "manifest.json").read_text())
for f in manifest["files"]:
    digest = hashlib.sha256((folder / f["name"]).read_bytes()).hexdigest()
    print("ok " if digest == f["sha256"] else "CHANGED", f["name"])
R
library(jsonlite)
library(digest)

folder <- "models/churn/3"  # <project>/models/<name>/<version>
manifest <- fromJSON(file.path(folder, "manifest.json"), simplifyVector = FALSE)
for (f in manifest$files) {
  d <- digest(file.path(folder, f$name), algo = "sha256", file = TRUE)
  cat(if (identical(d, f$sha256)) "ok " else "CHANGED", f$name, "\n")
}
10

Recap

Recap
  • A version keeps the fitted model, its preprocessing, its scores and a checksum of every file.
  • Check that scoring reproduces training before you trust a version.
  • Stages record where a version is; aliases say what it's used for, and moving one is how you promote and roll back.
  • Write the intended use yourself, including what the model must not decide.

Concepts in this lesson