liveBook · Manning

Nondeterminism

As explained in Machine Learning System Design

Nondeterminism is the property that identical apparent inputs may produce different outcomes because of uncontrolled state, data, timing, or randomness.

Nondeterminism makes a prediction vary even when the visible feature input appears unchanged. Randomness, current time, and other implicit data can affect the result, complicating reproducibility and debugging. section 13.1

A predictable prediction interface

A predict function that reads the current time internally and fixes a seed still hides an output-controlling parameter. Passing time and seed explicitly lets the caller reproduce a result or deliberately choose different conditions. section 13.1

Listing 13.2 A better design for a predict function
def predict(features, time=None, seed=42):
    if time is None:
        time = datetime.now()
    return model.predict(features, time, seed)

Inspect the better predict-function design, which exposes time and seed while retaining defaults for ordinary calls. section 13.1

How Machine Learning System Design covers it

How deep it goes
Explains hidden time and random state through contrasting predict-function designs, without developing algorithmic internals.
Examples
Uses stochastic text generation, Python predict functions, current time, random seeds, and explicit random state as examples.
What it assumes
Assumes familiarity with ML prediction functions and APIs, while introducing reproducibility through concrete parameter-control examples.
What you can do after
Diagnose irreproducible predictions by identifying implicit inputs and exposing time, seeds, and other output-controlling parameters.
How it connects
Connects nondeterminism to reproducibility, random seeds, explicit state, API design, and model versioning.

Also explained in

Compare how 3 books explain nondeterminism →

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.