Skip to content
svgbrier-over-time

Brier score over time

Are a deployed model's probabilities still trustworthy?

Demo data · seed 20261101 · 20 rows · default settings · 640 × 360SVG, lightSVG, darkDemo CSV

How to read it

  1. Read the line as the Brier score per period: lower is better.
  2. Compare with the dashed level at deployment.
  3. A sustained rise means predicted probabilities are drifting away from reality.
  1. Callout 1: Rising above the deployment level.
  2. Callout 2: Dashed line: the level at deployment.

Watch out

  • The score depends on the event rate: a seasonal rate change can move it without any model decay.

Defaults

No settings: the chart draws one way.

Pinned in the code

  • Draws the run's numbers as given (computed by the host's cs-ml evaluation or the Python/R engine); the chart computes nothing statistical.
  • Brier score = mean squared difference between the predicted probability of the positive class and the outcome (0/1); lower is better.
# Brier score over time — Codesplash Chart Lab (recipe "brier-over-time")
# controls: defaults
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

try:
    import codesplash as cs  # optional: the app's chart theme
except ImportError:
    cs = None
if cs:
    cs.use_codesplash(dark=False)
PALETTE = cs.palette(dark=False)["categorical"] if cs else plt.rcParams["axes.prop_cycle"].by_key()["color"]

df = pd.read_csv("brier-over-time-demo.csv", keep_default_na=False, na_values=[""])  # demo data (only empty cells are missing): Chart Lab → Code → Download demo CSV
df["week"] = pd.to_datetime(df["week"])

_tokens = cs.palette(dark=False) if cs else {}
SEQ = _tokens.get("sequential", ["#eff6fd", "#1a469d"])  # sequential ramp (low → high)
DIV = _tokens.get("diverging", ["#c13e2e", "#f3f5f8", "#0859ac"])  # negative, midpoint, positive
REF = _tokens.get("reference", "#4e5661")
GREY = _tokens.get("dim", "#ced1d6")
T = "week"
B = "Brier score"
BASE = "at deployment"
d = df.dropna(subset=[T, B]).sort_values(T)
fig, ax = plt.subplots(figsize=(7, 4))
ax.plot(d[T], d[B], marker="o", markersize=3, color=PALETTE[0], label="Brier score")
if BASE and d[BASE].notna().any():
    ax.axhline(d[BASE].dropna().iloc[0], color=REF, linestyle="--", linewidth=1, label="at deployment")
ax.set_ylim(bottom=0)
ax.set_xlabel(T)
ax.set_ylabel("Brier score")
ax.legend(fontsize=8)
plt.show()

Needs pandas, numpy, matplotlib · reads brier-over-time-demo.csv · app theme from the optional codesplash helper