all demos · interactive demos

Classical machine learning

Machine learning finds patterns in data instead of following hand-written rules. These demos show the classic ideas in their simplest form. Most of them learn from labelled examples (supervised learning): fitting a curve to predict a number or a probability, the gradient descent that trains most models, voting among similar cases, the widest-margin boundary of a support vector machine, flowcharts of yes/no questions and the forests and boosted ensembles built from them, and a small neural network, followed by how to judge whether any of them is any good. The last three find structure in data that has no labels at all (unsupervised learning). Each one runs live on a small fictional dataset, several of them borrowed from medicine, so you can add points, change the settings and watch the model respond.

01 Regression Fit a line or curve through blood pressure readings by least squares, drag points to see what moves the fit, and watch a flexible curve overfit. predicting a number 02 Gradient descent Watch a line find its way to the best fit by walking downhill on a map of its error, and see why the learning rate, the scaling of the data and the choice of optimiser matter. how models are trained 03 Logistic regression Turn a yes/no outcome into a probability with the S-curve, fit it by hand and by maximum likelihood, and read the odds ratios. predicting a probability 04 k-nearest neighbours Classify a new patient by asking the most similar patients already seen, and see how the number of neighbours and the scaling of features change the answer. learning by similarity 05 SVM Place points on a plot and watch a support vector machine draw the widest possible boundary between two classes, with linear, polynomial or RBF kernels. decision boundaries also in Classical NLP 06 Decision trees Grow a flowchart of yes/no questions that sorts patients by glucose and BMI, or thyroid results, and see each question as a cut through the data. classification you can read 07 Random forests Grow a hundred slightly different trees on resampled data and average their predictions: the ragged single-tree boundary smooths out. many trees, averaged 08 Gradient boosting Add small trees one at a time, each fitting what the model still gets wrong, and watch the curve take shape. many trees, in sequence 09 Neural networks Train a small network on circles, spirals and checkerboards, add layers and neurons, and see what each neuron has learned to detect. layers of simple units 10 Evaluating classifiers Move a test's threshold and follow sensitivity, specificity and the ROC curve, see why rare diseases make positive results unreliable, and pick a model by cross-validation. is the model any good? 11 k-means clustering Step through the two moves of k-means, assign and update, and find out when the clusters it finds are real and when they are not. grouping without labels 12 Principal component analysis Find the directions in which data varies most, rotate onto them, and squeeze eight lab results into a two-dimensional picture. fewer dimensions 13 Self-organising maps Watch a grid of units unfold over the data and sort it, without any labels, so that similar items end up side by side. mapping without labels

Everything runs in your browser: nothing you type or draw is sent anywhere.