Skip to content
svgtrial-history

Tuning history

Is the hyperparameter search still improving, and which trials were pruned?

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

How to read it

  1. Read each dot as a trial's score, in order.
  2. Read the step line as the best so far.
  3. If the best line is flat for many trials, the search has probably run its course.
  1. Callout 1: The running best.
  2. Callout 2: A completed trial.
  3. Callout 3: A pruned or failed trial.

Watch out

  • The best trial's score is optimistic: it was chosen for being highest. Test it on untouched data.

Defaults

Lower is better
Off
Say whether a lower score is better, for the running best line.

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.
  • The running best is the engine's when sent; otherwise the chart takes the best completed trial so far (pruned and failed trials never count).
  • Pruned trials stopped after their first folds (racing / median pruner), so their score covers fewer folds.
# Tuning history — Codesplash Chart Lab (recipe "trial-history")
# controls: minimize=false
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("trial-history-demo.csv", keep_default_na=False, na_values=[""])  # demo data (only empty cells are missing): Chart Lab → Code → Download demo CSV
df["status"] = pd.Categorical(df["status"].astype("string"), categories=["complete", "pruned", "failed"])

_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")
TRIAL = "trial"
SCORE = "ROC AUC"
BEST = None
STATUS = "status"
MINIMIZE = False  # lower scores are better
d = df.dropna(subset=[TRIAL]).sort_values(TRIAL)
status = d[STATUS].astype(str).str.lower() if STATUS else pd.Series("complete", index=d.index)
done = d[status == "complete"]
best = d[BEST] if BEST else (done[SCORE].cummin() if MINIMIZE else done[SCORE].cummax()).reindex(d.index).ffill()  # running best
fig, ax = plt.subplots(figsize=(8, 4.5))
ax.scatter(done[TRIAL], done[SCORE], s=22, color=PALETTE[0], label="complete")
pruned = d[status == "pruned"]
ax.scatter(pruned[TRIAL], pruned[SCORE], s=22, facecolors="none", edgecolors="grey", label="pruned")
failed = d[status == "failed"]
if len(failed):
    ax.scatter(failed[TRIAL], np.full(len(failed), np.nanmin(d[SCORE]) if len(done) else 0), marker="x", color="#ce5342", label="failed")
ax.step(d[TRIAL], best, where="post", color=REF, linewidth=1.6, label="best so far")
ax.set_xlabel(TRIAL)
ax.set_ylabel(SCORE)
ax.legend(fontsize=8)
plt.show()

Needs pandas, numpy, matplotlib · reads trial-history-demo.csv · app theme from the optional codesplash helper