SOCR · Data Science and Predictive Analytics, third edition

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.

Full catalogue
Ch 1 · 1.4
Simulator

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.

15 min
Ch 2 · 2.3
Misconception

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.

18 min
Ch 3 · 3.5
Diagnostic

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.

20 min
Ch 4 · 4.2
Explorer

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.

18 min
Ch 5 · 5.6
Comparator

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.

20 min
Ch 8 · 8.4
Comparator

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.

22 min
Ch 9 · 9.5
Misconception

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.

18 min
Ch 11 · 11.3
Explorer

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.

25 min
Ch 2 · 2.4
Explorer

Breakdown Points: Which Summaries Survive Contamination

Move a contaminated fraction anywhere on the line and watch the mean chase it while the median refuses.

14 min
Ch 2 · 2.9
Simulator

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.

18 min
Ch 3 · 3.5
Explorer

Regression Is a Projection

The hat matrix, orthogonal residuals, leverage, and why the least-squares line is not the principal axis.

16 min
Ch 5 · 5.3
Explorer

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.

18 min
Ch 7 · 7.2
Explorer

TF-IDF Geometry: Angle, Length, and What Similar Means

Six short documents, one weighting switch: watch cosine similarity separate topic from document length.

16 min
Ch 9 · 9.2
Comparator

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.

20 min
Ch 13 · 13.3
Animator

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.

18 min
Ch 12 · 12.2
Explorer

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.

18 min
Ch 1 · 1.6
Misconception

Floating Point Has Edges

Compute a variance three algebraically identical ways and watch one of them return a negative number.

15 min
Ch 3 · 3.2
Animator

Matrices as Motions

Watch a matrix act on the unit circle: rotation, scaling, shear, and the collapse that makes a regression unsolvable.

15 min
Ch 5 · 5.2
Explorer

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.

16 min
Ch 7 · 7.6
Misconception

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.

18 min
Ch 9 · 9.7
Explorer

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.

20 min
Ch 10 · 10.7
Simulator

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.

15 min
Ch 12 · 12.8
Explorer

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.

22 min
Ch 14 · 14.5
Explorer

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.

18 min
Ch 1 · 1.4
Explorer

Seeds, Streams, and Reproducibility

Why the same code gives different answers, and how a seed turns a random study into a repeatable one.

12 min
Ch 4 · 4.2
Explorer

SVD as an Optimal Summary

Rank-k truncation on an image and a data matrix, with the error bound made visible.

20 min
Ch 5 · 5.8
Misconception

Where Leakage Hides

Impute before splitting, select features on all the data, or split a time series at random — and watch validation lie.

22 min
Ch 8 · 8.5
Explorer

Clustering Through the Graph Laplacian

Non-convex shapes that defeat k-means fall apart cleanly in the spectral embedding.

22 min
Ch 11 · 11.2
Comparator

Importance Depends on the Question

Impurity, permutation, and SHAP-style attributions disagree — especially under correlation.

22 min
Ch 10 · 10.4
Builder

One Pass, Bounded Memory

Streaming means, variances, quantile sketches, and count-min counting.

20 min
Ch 12 · 12.5
Explorer

Backtesting Without Peeking

Rolling origins, expanding windows, and the horizon at which skill disappears.

22 min
Ch 14 · 14.2
Animator

Backpropagation, One Edge at a Time

A tiny network with every forward value and every gradient shown on the graph.

25 min
Ch 1 · 1.8
Explorer

Fairness Criteria Cannot All Hold

Adjust a classifier and watch demographic parity, equal opportunity, and calibration compete.

20 min
Ch 4 · 4.6
Misconception

Nonlinear Embeddings Invent Structure

Change perplexity and neighbours on data with no clusters, then watch clusters appear anyway.

22 min
Ch 6 · 6.4
Animator

The Kernel Trick, Drawn

Lift two-dimensional data into a feature space where a plane separates it.

20 min
Ch 8 · 8.7
Animator

EM, Step by Step

Soft assignments, monotone likelihood, and convergence to the wrong local optimum.

22 min
Ch 14 · 14.8
Misconception

Overparameterized and Still Improving

Push past the interpolation threshold and watch test error fall a second time.

22 min
Ch 2 · 2.7
Comparator

The Same Data, Six Charts

Axis limits, binning, aspect ratio, and colour scale — each one changes the story.

15 min
Ch 6 · 6.6
Comparator

Bagging, Boosting, and Variance

Grow trees one at a time and watch which method reduces bias and which reduces variance.

25 min
Ch 11 · 11.6
Explorer

Controlled Selection with Knockoffs

Manufacture decoy variables, then use them to bound the false discovery rate.

25 min
Ch 13 · 13.6
Explorer

Constraints Bind

Lagrange multipliers and KKT conditions made visual on a feasible region you draw.

22 min
Ch 13 · 13.8
Explorer

Where to Sample Next

A Gaussian process surrogate and the exploration-exploitation dial.

25 min

Nine clusters, fourteen chapters

Foundations & Data Quality

Ch 1, 2

Simulation, reproducibility, floating point, missingness mechanisms, robustness, and multiplicity.

8 live · 8 mapped

Mathematical Core

Ch 3, 4

Matrix computing, conditioning, projection geometry, and linear/nonlinear dimensionality reduction.

6 live · 6 mapped

Supervised Learning

Ch 5, 6

Bayes error, kNN boundaries, metric families, leakage, kernels, ensembles, and backpropagation.

6 live · 6 mapped

Unsupervised Learning & Text

Ch 7, 8

TF-IDF geometry, association rules, k-means, DBSCAN, spectral clustering, and mixtures.

5 live · 5 mapped

Validation & Feature Selection

Ch 9, 11

Resampling, calibration versus discrimination, decision curves, LASSO paths, and knockoffs.

6 live · 6 mapped

Systems & Performance

Ch 10

Columnar formats, chunking, Amdahl's law, and streaming computation in the browser.

2 live · 2 mapped

Temporal & Longitudinal

Ch 12

Autocorrelation, stationarity, filtering, survival curves, and forecast validation.

3 live · 3 mapped

Optimization

Ch 13

Loss landscapes, gradient descent variants, constraints, and Bayesian optimization.

3 live · 3 mapped

Deep Learning

Ch 14

Backpropagation, convolution, sequence models, generative models, and generalization.

3 live · 3 mapped