Statistical instruments you can turn, break, and read.
Each lab isolates one idea from the DSPA3 textbook that is easy to state and easy to get wrong — then hands you the controls that make the consequence obvious. Everything computes in your browser in TypeScript: no R, no installation, no server.
- 42
- interactive labs live
- 42
- labs mapped to the textbook
- 14
- chapters, 9 clusters
- 0
- bytes of your data uploaded
Predict, then observe
Every lab opens with a prompt whose most popular answer is wrong. The reveal comes from the instrument, not from prose.
Numerics you can inspect
Seeded RNG, QR and SVD, coordinate-descent LASSO, ROC and calibration — all pure TypeScript, all deterministic.
Every state has a URL
Found a pathological case? Copy the permalink. It reopens the exact scenario, controls and all.
Built for two audiences
Students get guided sequences and an R bridge back to the book. Teachers get presets, prompts, and teacher mode.
Start with the flagships
One lab per major theme, each carrying the misconception its chapter exists to correct.
Sampling Distributions & the Limits of the CLT
Separate the distribution of the data from the distribution of a statistic, and find where the central limit theorem stops applying.
Missingness Mechanisms: MCAR, MAR, MNAR
Delete data three different ways and watch which repairs work, which fail, and why more data never fixes a biased mechanism.
Conditioning, Collinearity, and Unstable Coefficients
Watch the condition number of a design matrix explode and see exactly which quantities become unidentifiable — and which do not.
PCA Geometry: Projection, Scale, and What Variance Means
Rotate a data cloud, change a measurement unit, and see principal components move — the projection is geometry, not magic.
Accuracy Is a Trap: Metrics Under Class Imbalance
Move a threshold, move the prevalence, and watch which performance numbers stay honest and which quietly lie.
Cluster Geometry: k-means, DBSCAN, and Shapes That Break Them
Compare centroid and density clustering on blobs, moons, and pure noise — and see why the elbow plot cannot tell you k.
Calibration Is Not Discrimination
Distort a model's probabilities without touching its ranking: AUC does not move a decimal place while every probability becomes wrong.
LASSO Paths, Cross-Validation, and False Discoveries
Trace coefficients from saturated to empty, then discover that the cross-validated λ is tuned for prediction — not for finding the right variables.
Breakdown Points: Which Summaries Survive Contamination
Move a contaminated fraction anywhere on the line and watch the mean chase it while the median refuses.
Testing Many Things at Once
Run 200 tests where nothing is real and still publish a finding — then watch Bonferroni and Benjamini–Hochberg trade power for error control.
Regression Is a Projection
The hat matrix, orthogonal residuals, leverage, and why the least-squares line is not the principal axis.
k-NN Boundaries, Bias–Variance, and the Bayes Floor
Watch the decision boundary go from memorized to over-smoothed, with training error at zero the whole time it is useless.
TF-IDF Geometry: Angle, Length, and What Similar Means
Six short documents, one weighting switch: watch cosine similarity separate topic from document length.
Holdout, k-Fold, LOO, Bootstrap: Estimating an Estimator
The same data and the same model give very different accuracy numbers — see each scheme's sampling distribution against the truth.
Gradient Descent: Step Size, Conditioning, and Momentum
Watch a convex bowl defeat gradient descent — the trouble is the condition number and the step size, not the landscape.
Autocorrelation, Stationarity, and Effective Sample Size
200 dependent observations can be worth 16 independent ones — see the ACF, the PACF, and the standard error you should have reported.
Floating Point Has Edges
Compute a variance three algebraically identical ways and watch one of them return a negative number.
Matrices as Motions
Watch a matrix act on the unit circle: rotation, scaling, shear, and the collapse that makes a regression unsolvable.
The Irreducible Floor
Overlapping class densities set a limit no classifier can pass. Try to beat it, then find out why your validation says you did.
Support, Confidence, and Lift
A rule with 90% confidence can be worthless. Lift tells you which of your discovered rules carry any information at all.
Net Benefit and Threshold Choice
Accuracy cannot pick a threshold. A stated harm-to-benefit ratio can — and the decision curve shows where a model earns its keep.
Amdahl's Ceiling
Add workers to a job with a serial fraction and watch the speedup flatten — then add coordination cost and watch it reverse.
Censoring and the Kaplan–Meier Estimator
Follow-up ends before everyone has the event. See why the product-limit estimator is the honest answer and what counting censored subjects as events does to it.
What a Convolution Actually Computes
Edit nine numbers and watch the feature map change. Weight sharing, stride, padding, ReLU, and pooling, with the parameter count next to the dense alternative.
Seeds, Streams, and Reproducibility
Why the same code gives different answers, and how a seed turns a random study into a repeatable one.
SVD as an Optimal Summary
Rank-k truncation on an image and a data matrix, with the error bound made visible.
Where Leakage Hides
Impute before splitting, select features on all the data, or split a time series at random — and watch validation lie.
Clustering Through the Graph Laplacian
Non-convex shapes that defeat k-means fall apart cleanly in the spectral embedding.
Importance Depends on the Question
Impurity, permutation, and SHAP-style attributions disagree — especially under correlation.
One Pass, Bounded Memory
Streaming means, variances, quantile sketches, and count-min counting.
Backtesting Without Peeking
Rolling origins, expanding windows, and the horizon at which skill disappears.
Backpropagation, One Edge at a Time
A tiny network with every forward value and every gradient shown on the graph.
Fairness Criteria Cannot All Hold
Adjust a classifier and watch demographic parity, equal opportunity, and calibration compete.
Nonlinear Embeddings Invent Structure
Change perplexity and neighbours on data with no clusters, then watch clusters appear anyway.
The Kernel Trick, Drawn
Lift two-dimensional data into a feature space where a plane separates it.
EM, Step by Step
Soft assignments, monotone likelihood, and convergence to the wrong local optimum.
Overparameterized and Still Improving
Push past the interpolation threshold and watch test error fall a second time.
The Same Data, Six Charts
Axis limits, binning, aspect ratio, and colour scale — each one changes the story.
Bagging, Boosting, and Variance
Grow trees one at a time and watch which method reduces bias and which reduces variance.
Controlled Selection with Knockoffs
Manufacture decoy variables, then use them to bound the false discovery rate.
Constraints Bind
Lagrange multipliers and KKT conditions made visual on a feasible region you draw.
Where to Sample Next
A Gaussian process surrogate and the exploration-exploitation dial.
Nine clusters, fourteen chapters
Foundations & Data Quality
Ch 1, 2Simulation, reproducibility, floating point, missingness mechanisms, robustness, and multiplicity.
8 live · 8 mapped
Mathematical Core
Ch 3, 4Matrix computing, conditioning, projection geometry, and linear/nonlinear dimensionality reduction.
6 live · 6 mapped
Supervised Learning
Ch 5, 6Bayes error, kNN boundaries, metric families, leakage, kernels, ensembles, and backpropagation.
6 live · 6 mapped
Unsupervised Learning & Text
Ch 7, 8TF-IDF geometry, association rules, k-means, DBSCAN, spectral clustering, and mixtures.
5 live · 5 mapped
Validation & Feature Selection
Ch 9, 11Resampling, calibration versus discrimination, decision curves, LASSO paths, and knockoffs.
6 live · 6 mapped
Systems & Performance
Ch 10Columnar formats, chunking, Amdahl's law, and streaming computation in the browser.
2 live · 2 mapped
Temporal & Longitudinal
Ch 12Autocorrelation, stationarity, filtering, survival curves, and forecast validation.
3 live · 3 mapped
Optimization
Ch 13Loss landscapes, gradient descent variants, constraints, and Bayesian optimization.
3 live · 3 mapped
Deep Learning
Ch 14Backpropagation, convolution, sequence models, generative models, and generalization.
3 live · 3 mapped
