Lab catalogue
8 labs are live and 34 more are mapped to the textbook. Clusters follow the fourteen DSPA3 chapters, so a lab can be dropped into a lecture or a homework set without rearranging anything else.
Foundations & Data Quality
Chapters 1, 2Simulation, reproducibility, floating point, missingness mechanisms, robustness, and multiplicity.
Foundations, Data Science, Ethics, and the R Environment · Data Quality, Missingness, and Exploratory Visual Analytics
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.
Seeds, Streams, and Reproducibility
Why the same code gives different answers, and how a seed turns a random study into a repeatable one.
Floating Point Has Edges
Catastrophic cancellation, non-associative sums, and the variance formula that returns a negative number.
Fairness Criteria Cannot All Hold
Adjust a classifier and watch demographic parity, equal opportunity, and calibration compete.
Breakdown Points
Drag one outlier and see which summaries follow it and which refuse to.
The Same Data, Six Charts
Axis limits, binning, aspect ratio, and colour scale — each one changes the story.
Testing Many Things at Once
Family-wise error, false discovery rate, and the garden of forking paths.
Mathematical Core
Chapters 3, 4Matrix computing, conditioning, projection geometry, and linear/nonlinear dimensionality reduction.
Linear Algebra, Matrix Computing, and Regression · Linear and Nonlinear Dimensionality Reduction
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.
Matrices as Motions
Watch a matrix act on the unit circle: rotation, scaling, shear, and collapse.
Regression Is a Projection
The hat matrix, the residual space, and why the residuals are orthogonal to the fit.
SVD as an Optimal Summary
Rank-k truncation on an image and a data matrix, with the error bound made visible.
Nonlinear Embeddings Invent Structure
Change perplexity and neighbours on data with no clusters, then watch clusters appear anyway.
Supervised Learning
Chapters 5, 6Bayes error, kNN boundaries, metric families, leakage, kernels, ensembles, and backpropagation.
Supervised Classification · Black-Box Methods: Neural Networks, SVM, and Ensembles
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.
The Irreducible Floor
Overlapping class densities set a limit no classifier can pass. Try to beat it.
k Controls the Boundary
From jagged memorization at k = 1 to a nearly linear boundary at large k.
Where Leakage Hides
Impute before splitting, select features on all the data, or split a time series at random — and watch validation lie.
The Kernel Trick, Drawn
Lift two-dimensional data into a feature space where a plane separates it.
Bagging, Boosting, and Variance
Grow trees one at a time and watch which method reduces bias and which reduces variance.
Unsupervised Learning & Text
Chapters 7, 8TF-IDF geometry, association rules, k-means, DBSCAN, spectral clustering, and mixtures.
Text Mining, NLP, and Association Rule Learning · Unsupervised Clustering
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.
Documents as Vectors
Term weighting, cosine similarity, and why raw counts mislead.
Support, Confidence, and Lift
A high-confidence rule can still be worthless. Lift explains why.
Clustering Through the Graph Laplacian
Non-convex shapes that defeat k-means fall apart cleanly in the spectral embedding.
EM, Step by Step
Soft assignments, monotone likelihood, and convergence to the wrong local optimum.
Validation & Feature Selection
Chapters 9, 11Resampling, calibration versus discrimination, decision curves, LASSO paths, and knockoffs.
Model Performance Assessment and Validation · Variable Importance and Controlled Feature Selection
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.
Which Resampling Scheme?
Holdout, k-fold, repeated CV, LOOCV, and the bootstrap, scored on bias, variance, and cost.
Net Benefit and Threshold Choice
Accuracy cannot pick a threshold. A loss function can.
Controlled Selection with Knockoffs
Manufacture decoy variables, then use them to bound the false discovery rate.
Importance Depends on the Question
Impurity, permutation, and SHAP-style attributions disagree — especially under correlation.
Systems & Performance
Chapters 10Columnar formats, chunking, Amdahl's law, and streaming computation in the browser.
Big Data, Formats, and Computational Performance
One Pass, Bounded Memory
Streaming means, variances, quantile sketches, and count-min counting.
Amdahl's Ceiling
Add workers to a job with a serial fraction and watch the speedup flatten.
Temporal & Longitudinal
Chapters 12Autocorrelation, stationarity, filtering, survival curves, and forecast validation.
Time Series, Longitudinal, and Survival Analysis
Dependence Breaks the Standard Error
Serially correlated data with n = 500 can carry the information of n = 40.
Backtesting Without Peeking
Rolling origins, expanding windows, and the horizon at which skill disappears.
Censoring Is Information
Kaplan-Meier, hazard ratios, and why dropping censored cases biases everything.
Optimization
Chapters 13Loss landscapes, gradient descent variants, constraints, and Bayesian optimization.
Optimization and Numerical Methods
Walking Downhill
Step size, momentum, and conditioning on a landscape you can rotate and stretch.
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.
Deep Learning
Chapters 14Backpropagation, convolution, sequence models, generative models, and generalization.
Deep Learning and Representation Learning
Backpropagation, One Edge at a Time
A tiny network with every forward value and every gradient shown on the graph.
What a Filter Sees
Design a kernel, slide it, and read the feature map it produces.
Overparameterized and Still Improving
Push past the interpolation threshold and watch test error fall a second time.
