Lab catalogue
42 labs are live and 0 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.
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.
Floating Point Has Edges
Compute a variance three algebraically identical ways and watch one of them return a negative number.
Seeds, Streams, and Reproducibility
Why the same code gives different answers, and how a seed turns a random study into a repeatable one.
Fairness Criteria Cannot All Hold
Adjust a classifier and watch demographic parity, equal opportunity, and calibration compete.
The Same Data, Six Charts
Axis limits, binning, aspect ratio, and colour scale — each one changes the story.
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.
Regression Is a Projection
The hat matrix, orthogonal residuals, leverage, and why the least-squares line is not the principal axis.
Matrices as Motions
Watch a matrix act on the unit circle: rotation, scaling, shear, and the collapse that makes a regression unsolvable.
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.
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.
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.
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.
TF-IDF Geometry: Angle, Length, and What Similar Means
Six short documents, one weighting switch: watch cosine similarity separate topic from document length.
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.
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.
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.
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.
Importance Depends on the Question
Impurity, permutation, and SHAP-style attributions disagree — especially under correlation.
Controlled Selection with Knockoffs
Manufacture decoy variables, then use them to bound the false discovery rate.
Systems & Performance
Chapters 10Columnar formats, chunking, Amdahl's law, and streaming computation in the browser.
Big Data, Formats, and Computational Performance
Temporal & Longitudinal
Chapters 12Autocorrelation, stationarity, filtering, survival curves, and forecast validation.
Time Series, Longitudinal, and Survival Analysis
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.
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.
Backtesting Without Peeking
Rolling origins, expanding windows, and the horizon at which skill disappears.
Optimization
Chapters 13Loss landscapes, gradient descent variants, constraints, and Bayesian optimization.
Optimization and Numerical Methods
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.
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
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.
Backpropagation, One Edge at a Time
A tiny network with every forward value and every gradient shown on the graph.
Overparameterized and Still Improving
Push past the interpolation threshold and watch test error fall a second time.
