cross-validation

← ~/visualizations

cross-validation #

Visualizes held-out evaluation with k-fold cross-validation: the dataset is partitioned into k disjoint folds; each step highlights one fold as the validation (held-out) set while the others are used for training; the per-fold validation loss L(y, ŷ) is recorded and then aggregated (averaged) into a single cross-validation estimate of expected generalization error. A blinking note indicates LOOCV as the special case k = N.

canvasclick to interact

⏮◀◀▶▶STEP0.25x1xZOOM

t=0s

practical uses #

technical notes #

Pure Canvas2D with a 4px-snapped blocky aesthetic on black. Animation cycles through folds in discrete steps (~520ms each) using ease() for within-step progression, then transitions into an aggregation phase that eases the running mean toward the full k-fold mean. No randomness: per-fold losses are deterministic sinusoidal values for repeatable playback.

← kl-divergencerandom-variables →