A classical model is a fixed shape fitted to a table of features: a weighted sum draws a straight boundary, a tree draws an axis-aligned staircase, and a sum of hundreds of shallow trees draws almost any boundary while still cutting along the features one at a time, which is why boosted trees were the default on tables for twenty years, until tabular foundation models overtook them on small and medium tables in 2025 (section 4).
You need: log-loss and the hinge loss (Loss functions); eigenvectors and the SVD for PCA (Linear algebra for ML). Penalties are on Regularisation, and how to score a classifier is on Evaluation metrics; this page links them rather than repeating them.
Shading is the model's probability of the blue class; the solid line is where it decides. Computed live by this page's own models, which reproduce scikit-learn (the check is under the Boundary lab, where seven models can be set side by side); the quoted numbers are in src/check/hero_numbers.json.
| Method | How it decides | Assumes | Strong when | Weak when |
|---|---|---|---|---|
| Linear, logistic regression | a weighted sum of the features | effects add up (on the log-odds scale for logistic) | few rows, many features, interpretation matters; a baseline always | interactions and thresholds the features do not encode |
| Naive Bayes | Bayes' rule, features independent given the class | conditional independence | text, very little data, speed | correlated features: probabilities come out overconfident |
| Decision tree | a sequence of yes/no questions on one feature at a time | axis-aligned, piecewise-constant structure | readability, mixed feature types | alone: high variance, staircase boundaries |
| Random forest | average of many decorrelated deep trees | as a tree | a strong model with almost no tuning; free out-of-bag error | smooth trends, extrapolation |
| Gradient boosting | shallow trees added one by one, each fitting what is left | as a tree | tabular data, especially large tables on CPU | needs early stopping and some tuning |
| SVM | the widest margin between classes, in a kernel's feature space | a kernel that matches the data's geometry | small and medium data, many features | tens of thousands of rows and more; probabilities |
| kNN | vote or mean of the k closest training points | a distance that means something | low dimensions, lots of data, no training time | high dimensions, unscaled features, slow queries |
| Paradigm | Task | Canonical methods | Section |
|---|---|---|---|
| Supervised | Regression (numeric target) | linear and polynomial regression, ridge, lasso, elastic net, trees, gradient boosting | 1, 3 |
| Supervised | Classification (categorical target) | logistic regression, naive Bayes, SVM, kNN, trees and their ensembles | 1 to 6 |
| Unsupervised | Clustering | k-means, hierarchical, DBSCAN, Gaussian mixtures fitted by EM | 7 |
| Unsupervised | Anomaly detection | isolation forest, one-class SVM, density or reconstruction thresholds | 8 |
| Unsupervised | Dimensionality reduction | PCA, t-SNE, UMAP, autoencoders | 9 |
The comparison-level summary is on the parent, Topic: ml-fundamentals (Reading tab, "Classical ML: still the default on tables"); this page owns the detail.
Linear regression predicts ŷ = wTx + b, fitted by least squares; the closed form w = (XTX)−1XTy is the maximum-likelihood fit under Gaussian noise (Loss functions). Polynomial regression is the same model on powers and products of the features, still linear in the weights. Ridge (L2), lasso (L1, some weights exactly zero) and elastic net (both) add a penalty; the geometry is on Regularisation.
Logistic regression is a linear model, a sigmoid and binary cross entropy: p(y = 1 | x) = σ(wTx + b). The weights act additively on the log-odds, so the boundary is a hyperplane: the straight line in the hero's first panel, which cannot enclose a ring unless the features are transformed first (circles in the lab, against an RBF SVM). Softmax regression is the multiclass version, one weight vector per class. scikit-learn's LogisticRegression is L2-penalised by default with C = 1, minimising ½||w||2 + CΣ log-loss (user guide): a "plain" logistic regression in scikit-learn shrinks its weights.
Naive Bayes applies Bayes' rule assuming the features independent given the class: p(y | x) ∝ p(y) ∏j p(xj | y). Each factor is estimated alone (word frequencies per class for text, a Gaussian per feature for numbers), so training is one counting pass. The assumption is almost never true, yet it is a strong cheap baseline for text: on short snippets it beat SVMs, and NBSVM (an SVM on naive Bayes log-count ratios) was a strong text baseline for years (Wang and Manning 2012). The generative model reaches its best error with fewer examples, though logistic regression ends lower with enough data (Ng and Jordan 2002). What breaks is the probability, and the picture shows why.
Posterior = 3m / (3m + 1) for m copies derived, illustrative ratio. Correlated features double-count evidence, so naive Bayes probabilities come out overconfident; recalibrate before using them. The calibration animation on Evaluation metrics does this to a real naive Bayes model.
A tree asks one yes/no question about one feature ("is mean radius ≤ 0.26?", in standardised units) and predicts, in each leaf, the majority class or mean target of the training points that reach it. It is grown greedily, CART style (Breiman, Friedman, Olshen and Stone 1984): at each node try every feature and every threshold between neighbouring distinct values (scikit-learn uses the midpoint) and keep the split that lowers the children's weighted impurity most.
Fig. 1 grows one on real tumours: 398 training tumours from the Wisconsin breast cancer data, two features (mean radius across, mean texture in depth, both standardised). Every leaf is a column over its box of the plane, as tall as its share of malignant tumours, which is its prediction (blue malignant, orange benign); each tumour rides on its leaf.
Unlimited, a tree fits any training set exactly, and its predictions change a lot when a few points change (high variance); depth, a minimum leaf size or cost-complexity pruning hold it back. The chart is Fig. 1's run: test accuracy peaks at depth 4 and falls as the tree memorises.
Greedy means one step ahead: a split useless alone but making the next one perfect can be missed at depth 1 (XOR in the lab; the hero's XOR data shows the depth-3 tree at 55% held out). Trees need no feature scaling (only the order of values matters), handle mixed types and read as rules. Axis-aligned staircases are a weakness on a diagonal boundary and, on tables, a strength: rotating a table's features hurts trees and helps nothing, because real tabular features carry meaning one at a time (Grinsztajn et al., section 4).
Defaults reproduce scikit-learn's DecisionTreeClassifier(max_depth = d, random_state = 0) independently: identical predictions on a 41 × 41 grid at every depth, and the same accuracies (recompute.py: depth 4 best on test at 89.5%; no limit 55 leaves, 100% training, 86.0% test; predicting "benign" for all scores 62.6%). Data: UCI Breast Cancer Wisconsin (Diagnostic), 569 tumours, 70/30 stratified split.
Bagging (bootstrap aggregating) trains many models, each on a bootstrap sample of the rows (n draws with replacement, which leaves out about 1 − (1 − 1/n)n ≈ 1/e ≈ 36.8% of the rows), and averages or votes (Breiman 1996). Averaging B models of variance σ2 and pairwise correlation ρ leaves ρσ2 + (1 − ρ)σ2/B: more trees remove the second term, only less correlated trees reduce the first (ESL eq. 15.1). A random forest lowers ρ by letting each split consider only a random subset of the features (Breiman 2001; √p for classification is usual; scikit-learn's regressor defaults to all features since version 1.1, which is plain bagging, docs). The rows a tree never saw give an out-of-bag error for free (the lab shows it). Forests are close to tuning-free: across six algorithms on 38 OpenML datasets, random forest (ranger) gained least from tuning, 0.006 AUC against 0.042 for SVMs (Probst, Boulesteix and Bischl 2019, Table 2).
Gradient boosting (Friedman 2001) treats the ensemble's predictions F as the parameters and takes gradient steps in function space: each new tree fits the negative gradient of the loss with respect to F, exactly the residual y − F(x) for squared error, and is added with a small learning rate ν (shrinkage). Each shallow tree is high-bias and low-variance; the sum drives bias down stage by stage and eventually fits the noise, so the number of stages is set by early stopping on held-out data. AdaBoost is the same idea with the exponential loss (Friedman, Hastie and Tibshirani 2000), which is why it suffers under label noise (Loss functions, "the margin").
Fig. 2 is the same real curve three ways: head acceleration in simulated motorcycle crashes against time after impact (Silverman 1985, the mcycle data), 133 readings, every fourth held out (green). The front plate holds the readings and the ensemble's curve (blue); the plates behind hold its trees. One tree overfits, a forest never gets worse with more trees, boosting is best near 20 stages and then rises.
The tree and boosting reproduce scikit-learn independently (DecisionTreeRegressor and GradientBoostingRegressor(learning_rate = 0.3, max_depth = 2): predictions identical to 10−13, training error at every stage identical). Held-out errors in recompute.py: best single tree at depth 4 (711 g²) against 905 unlimited; boosting best near 20 stages (716) rising to 888 at 200; scikit-learn's own forests (5 seeds) settle between 807 and 821 from 50 trees on and never rise. The forest here draws its own bootstrap samples, so its numbers differ slightly from scikit-learn's; each of its trees is identical to scikit-learn's on the same sample. With only 33 held-out readings (variance 2,828 g²) a difference of a few dozen is noise. Data: MASS::mcycle.
XGBoost (Chen and Guestrin 2016) makes each step a second-order (Newton) step, using the loss's first and second derivatives, with a charge γ per leaf and an L2 shrink λ on leaf values; it also added column and row subsampling, a sparsity-aware split finder for missing values, and a weighted quantile sketch for approximate splits.
With gi, hi the first and second derivatives of the loss at the current prediction and G, H their sums over a leaf:
So the loss needs usable curvature: the Huber loss has second derivative 0 beyond its threshold, leaves full of large errors get H ≈ 0, and the step is set by λ alone. Correction to the old pageIt said XGBoost prefers twice-differentiable losses "like log-cosh over Huber". The direction is right, but XGBoost ships its own answer: the objective reg:pseudohubererror, "a twice differentiable alternative to absolute loss", with huber_slope as its threshold, alongside reg:absoluteerror and reg:quantileerror, which use smooth approximations (XGBoost parameters, read 3 October 2026). Log-cosh is not a built-in objective.
LightGBM (Ke et al. 2017) bins each feature into a histogram (255 bins by default) so the split search runs over bins, not rows, and grows trees leaf-wise instead of level by level (the figure).
LightGBM also samples rows by gradient size (GOSS: keep the large-gradient rows, subsample the rest) and bundles mutually exclusive sparse features (EFB); it reported training up to over 20 times faster than conventional gradient boosting at the same accuracy. CatBoost (Prokhorenkova et al. 2018) encodes categorical features by ordered target statistics and uses ordered boosting: each row's gradient comes from a model that has not seen that row, removing a target leak ("prediction shift") that plain boosting has; its trees are oblivious (the same split at every node of a level). Its defaults are strong: on TabArena the default CatBoost is the best untuned tree model (section 4).
Level-wise (XGBoost's default grow_policy, depthwise, capped by max_depth = 6): every node of a level is split, even where the gain is small.
Leaf-wise (LightGBM, capped by num_leaves = 31 by default): lower loss for the same number of leaves, deeper trees, so it overfits small data sooner unless num_leaves or min_data_in_leaf are limited.
Defaults: XGBoost parameters (grow_policy, max_depth) and LightGBM parameters (num_leaves, max_bin 255). XGBoost's hist method can also grow loss-guided (leaf-wise). Schematic, not a fitted tree.
Until 2024, yes, with a caveat about size; on the dated evidence it is now "on large tables and on CPUs, yes; on small and medium ones, no". The case for trees was made by Grinsztajn, Oyallon and Varoquaux (2022, 45 datasets of about 10K rows): neural networks are biased to overly smooth functions, are hurt by uninformative features, and are rotation-invariant while tabular features are not; each reason was tested. Then a transformer pretrained on millions of synthetic tables, TabPFN v2, reported beating tuned ensembles on up to 10,000 samples in one forward pass (Nature, January 2025), and the living TabArena leaderboard now ranks such foundation models first.
| Study | Data | Finding |
|---|---|---|
| Grinsztajn, Oyallon and Varoquaux, July 2022 | 45 datasets, "medium-sized data (~10K samples)", 20,000 compute hours of hyperparameter search per learner | "Tree-based models remain state-of-the-art on medium-sized data (~10K samples) even without accounting for their superior speed." Three reasons, each tested: neural networks are biased to overly smooth functions, are hurt by uninformative features, and are rotation-invariant while tabular features are not. |
| McElfresh et al., May 2023 (NeurIPS 2023) | 19 algorithms, 176 datasets | The "NN vs. GBDT" debate is overemphasised: on many datasets the gap is negligible, or light tuning of a boosted tree matters more than the choice of family. TabPFN (v1) was the best on average despite being limited to 3,000 training samples. |
| Hollmann et al. (TabPFN v2), Nature, 8 January 2025 | a transformer pretrained on millions of synthetic tables; predicts in one forward pass | "Outperforms all previous methods on datasets with up to 10,000 samples by a wide margin"; "In 2.8 s, TabPFN outperforms an ensemble of the strongest baselines tuned for 4 h in a classification setting." reported by its authors |
| Erickson et al. (TabArena), June 2025, v4 November 2025 | 51 curated datasets, living leaderboard | "While gradient-boosted trees are still strong contenders on practical tabular datasets, we observe that deep learning methods have caught up under larger time budgets with ensembling. At the same time, foundation models excel on smaller datasets." |
The leaderboard on 2 October 2026 (TabArena v0.1.9.4), with the sibling benchmark BeyondArena (142 datasets, temporal and grouped splits as well as random ones, bucketed by training rows). Scores are Elo ratings from pairwise comparisons on each dataset's metric (ROC AUC, log-loss or RMSE), anchored so that a default random forest scores 1000 on TabArena; a gap of 400 means a 10 to 1 expected win rate; whiskers are bootstrap 95% intervals (TabArena leaderboard, CSV files read 3 October 2026). Pick a size bucket in the chart: boosted trees climb as the tables grow.
In practice: on a table of up to about 100,000 rows with a GPU and a licence that allows it, try a tabular foundation model first; it needs no tuning. Otherwise, and always as the baseline to beat, a boosted tree with early stopping (CatBoost's defaults, or LightGBM with a modest search). A random forest is the model that needs least care. Where the split is temporal or grouped, use BeyondArena's matching subset, not the random-split ranking.
Shown: the top 8 entries, the best entry of every family, and the default random forest for reference (TabArena anchors it at 1000; BeyondArena's scale is anchored separately, so its numbers are not comparable with TabArena's). "Tuned + ensembled" means 200 configurations tuned and the best ones ensembled under the same budget for every model; training times are medians per 1,000 rows, on GPU for foundation models. Models only; whole AutoML systems are ranked separately. Many of the newest foundation models (September 2026 entries) are described only by their leaderboard links here, and several carry non-commercial licences, flagged per row. The maintainers also develop some of the ranked models and say so on the site.
A support vector machine (Cortes and Vapnik 1995) looks for the separating hyperplane with the widest margin: the band, of width 2/||w|| between the lines where the score wTx + b equals ±1, that it keeps clear of training points. Real data are rarely separable, so the soft margin lets points into the band at a price set by C:
The solution depends only on the points on or inside the margin, the support vectors: in the dual every other point has weight αi = 0, and the score is f(x) = Σ αiyi K(xi, x) + b with 0 ≤ αi ≤ C. Because only dot products appear, the kernel trick swaps in a kernel K, a dot product in a feature space never built: the RBF kernel exp(−γ||x − x′||2) corresponds to an infinite-dimensional one, the polynomial kernel (xTx′ + c)d to all monomials up to degree d. γ sets how far one point's influence reaches; scikit-learn's default, "scale", is 1/(number of features × variance of X).
Fig. 3 draws the margin as C grows, without and with a kernel: 140 training points from two interleaved moons (60 more held out). The surface is the SVM's score f(x) as a height (capped at ±2.5); it crosses the floor along the decision line, f = 0. The glass plates are f = +1 and f = −1, so the dashed lines are the margin; every point rides at its own score, and the lit points are the support vectors.
Defaults reproduce scikit-learn's SVC independently (recompute.py): linear kernel, C from 0.01 to 1: support vectors 110 → 54, margin width 3.12 → 1.29, training accuracy stuck at 81.4%; RBF kernel at C = 1: 55 support vectors, 93.6% training and 93.3% test accuracy. Decision values agree with libsvm to within 0.013 everywhere (both solvers stop at tolerance 10−3). Data: scikit-learn make_moons(200, noise = 0.25, random_state = 0), standardised.
SVM scores are not probabilities: the hinge loss is minimised by the sign of the true class probability and nothing more (Bartlett et al., on Loss functions). They remain strong on small and medium data with many features, and are the most tuning-sensitive of six algorithms in Probst et al., so they need the search of section 10.
The scikit-learn guide puts libsvm's training cost "between O(nfeatures × nsamples2) and O(nfeatures × nsamples3)", while the linear solver in LinearSVC "can scale almost linearly to millions of samples" (SVM user guide). scikit-learn's probability=True fits Platt scaling, "logistic regression on the SVM's scores, fit by an additional cross-validation on the training data", which is expensive and can disagree with the decision function (user guide, after Platt 1999). The page's SVM is the same solver family as libsvm: sequential minimal optimisation, which changes two αs at a time, with libsvm's second-order rule for choosing the pair (Fan, Chen and Lin 2005).
k nearest neighbours has no training step: it stores the training set and returns the majority class (or mean target) of the k closest points. k = 1 reproduces every training label (zero training error, a jagged boundary); a large k smooths towards the overall majority (both in the lab). Because everything rests on distances, feature scaling is mandatory: a feature measured in thousands swamps one measured in fractions (the same reason PCA needs standardising, section 9). A naive query compares against all n stored points, O(nd) per query; tree indexes help in a few dimensions and approximate nearest-neighbour indexes such as HNSW (Malkov and Yashunin 2016) in many. The same machinery, on learned embeddings, is vector retrieval (Topic: rag-and-retrieval).
In high dimensions, distances stop discriminating. Under broad conditions the ratio of the nearest to the farthest distance from a query tends to 1 as dimension grows (Beyer et al. 1999), so "nearest" stops meaning "similar". That is the curse of dimensionality for kNN; it bites least where the data lie near a low-dimensional surface, which is why kNN works on good embeddings.
. Lloyd's iterations from given centres reproduce scikit-learn's KMeans(init = centres, algorithm = "lloyd") to 10−15; the mixture reproduces GaussianMixture(covariance_type = "full", reg_covar = 10−6) from the same start after 1, 5 and 30 iterations to 10−15; DBSCAN's labels are identical to scikit-learn's on the moons and blobs (src/check/check_ml.mjs). Restart counts are computed live.
k-means alternates two steps: assign each point to its nearest centre, then move each centre to the mean of its points. Each step can only lower the inertia, so it always stops, but at a local minimum that depends on the start. k-means++ picks each new starting centre with probability proportional to its squared distance from the nearest centre already chosen; its expected inertia is within a factor O(log k) of the optimum before any iteration (Arthur and Vassilvitskii 2007). scikit-learn uses a greedy variant that tries 2 + ⌊ln k⌋ candidates per centre and keeps the best (KMeans); the page uses the plain rule. k-means assumes round clusters of similar size; the same card switches to the methods that do not.
The figure runs each method in four steps on the same points; switch the method on the card.
| Method | One-liner | Watch out |
|---|---|---|
| k-means | alternate: assign each point to its nearest centre, move each centre to the mean of its points; minimises the within-cluster sum of squares (inertia) | you choose k (elbow or silhouette); assumes round clusters of similar size; depends on the start (use k-means++ and several restarts) |
| Hierarchical (agglomerative) | start with every point alone and repeatedly merge the two closest clusters by a linkage: single (closest pair), complete (farthest pair), average, or Ward (smallest increase in variance); cut the dendrogram at the level you want | the pairwise distances alone take O(n2) memory and the classic algorithm O(n3) time (O(n2) for single linkage, Sibson 1973); the linkage changes the answer |
| DBSCAN | density: points with at least minPts neighbours within eps are core points; clusters are what core points reach; the rest is noise (Ester et al. 1996) | finds any shape and needs no k, but one eps must suit every cluster's density |
| Gaussian mixture + EM | soft clustering: each cluster a Gaussian with its own weight, mean and covariance; EM alternates responsibilities (E) and parameter updates (M) (Dempster, Laird and Rubin 1977) | local optima; k still chosen (BIC helps); covariances can collapse onto a single point without regularisation |
Seeded and computed live illustrative. The drawn tree uses all 272 eruptions and grows until each point is alone; the score uses 100 trees on random samples of 256 rows, Liu et al.'s defaults, and adds c(m) for a leaf still holding m > 1 identical points (16 eruptions repeat exactly). Data: datasets::faithful.
Anomalies are rare, so this is usually unsupervised: model what normal looks like and flag what does not fit. Isolation forest (Liu, Ting and Zhou 2008) inverts the usual question: instead of measuring how far a point is from the rest, it counts how many random cuts it takes to fence the point off alone. A point that is few and different is isolated in few cuts.
It needs no distances, so it scales to large, high-dimensional data. Evaluate with precision and recall, not accuracy or ROC alone: with 1 anomaly in 1,000, "nothing is anomalous" is 99.9% accurate, and a small false positive rate still swamps the true alarms (the threshold lab on Evaluation metrics shows this on real scores with rare positives).
The alternatives model normal directly: a one-class SVM (Schölkopf et al. 2001) separates the data from the origin in kernel space with a fraction ν of outliers allowed; density and reconstruction thresholds flag low likelihood under a fitted density (a Gaussian mixture, section 7) or a large reconstruction error from PCA or an autoencoder (section 9); the local outlier factor compares a point's local density with its neighbours' (Breunig et al. 2000).
PCA finds the orthogonal directions of greatest variance: the eigenvectors of the covariance matrix, ordered by eigenvalue, equivalently the right singular vectors of the centred data matrix (scikit-learn computes it by SVD; the projection and the SVD are on Linear algebra for ML). Projecting on the first m keeps the most variance any m-dimensional linear projection can, and the eigenvalue shares are the "explained variance".
Fig. 4 runs it on three real measurements of 178 wines (flavanoids, total phenols and OD280/OD315, the three that weigh most in the first component of all 13, each standardised); the colours are the three cultivars.
It is linear, and it is not scale-invariant: on raw data the feature with the largest numbers wins. Predict: on 13 wine measurements, how much variance does the first component of the raw data explain?
Defaults reproduce scikit-learn's PCA independently: raw, PC1 explains 99.81%, almost all of it proline (variance 98,610 against 203 for magnesium and under 12 for the other eleven); standardised, PC1 36.2% and PC2 19.2%, and the three cultivars separate. Explained-variance ratios agree to 10−15 (src/check). Data: UCI Wine via scikit-learn's load_wine.
t-SNE (van der Maaten and Hinton 2008) and UMAP (McInnes, Healy and Melville 2018) are nonlinear embeddings for pictures: they keep each point's neighbours close and give up on everything else. In their plots, cluster sizes and the distances between clusters mean little, and a perplexity or neighbour count changes the picture (Wattenberg, Viégas and Johnson 2016, with live examples). Use them to look, never as features for a model or as evidence of cluster structure on their own. Autoencoders are the nonlinear, learned version of PCA: a network squeezed through a narrow layer and trained to reconstruct its input (a linear autoencoder with squared error learns the same subspace as PCA).
| Method | Idea | When |
|---|---|---|
| Grid search | every combination of a few values per hyperparameter | one or two hyperparameters, cheap models |
| Random search | sample configurations at random from the ranges | usually beats grid at equal budget, because the few hyperparameters that matter get many distinct values instead of few (Bergstra and Bengio 2012) |
| Bayesian optimisation | fit a surrogate of score against configuration (a Gaussian process, Snoek, Larochelle and Adams 2012, or a tree-structured Parzen estimator, Bergstra et al. 2011) and choose the next trial by expected improvement | expensive trials; Optuna (Akiba et al. 2019) and Hyperopt default to TPE |
| Successive halving, Hyperband, ASHA | start many configurations on a small budget, keep the best fraction, give survivors more (Jamieson and Talwalkar 2016; Hyperband runs several such brackets, Li et al. 2018; ASHA promotes asynchronously across many workers, Li et al. 2020) | deep learning and boosting, where a partly trained run already says something |
Bergstra and Bengio's argument is geometric. With 9 trials on a 3 × 3 grid, each hyperparameter gets only 3 distinct values; 9 random trials give 9 of each. When only some hyperparameters matter, which they found to be the usual case, a grid wastes most trials on the ones that do not. Random search also has a budget rule that needs no knowledge of the surface: with n independent trials, the chance that at least one lands in the best 5% of the space is 1 − 0.95n, which passes 95% at n = 60 (1 − 0.9560 = 0.954) derived.
On this surface every method ends within the cross-validation noise of the best cell; searching harder than that noise only fits the validation folds (Cawley and Talbot 2010): report a held-out score, or nest the search inside an outer cross-validation.
Here both hyperparameters matter about equally (each explains about 35% of the variance of accuracy across the box, recompute.py), so Bergstra and Bengio's low-effective-dimension case does not hold, and a 2-D grid is not reliably worse: a 4 × 4 grid happens to land on 99.00%, a 5 × 5 grid only on 98.83%, which is luck of alignment. Add hyperparameters that do nothing (a cache size, a tolerance far below the noise) and the grid collapses: 27 trials on a 3 × 3 × 3 grid test only 9 distinct (C, gamma) pairs and reach 98.39%, while random search with the same 27 trials always gets 27 distinct pairs. Bayesian optimisation reaches the ridge in fewer trials on median.
The surface was computed offline with scikit-learn (src/data/svm_surface.py, 1,517 settings × 5 folds): best 99.11% at C = 2, gamma = 2−3; 20.9% of the box reaches 98.5%. Bayesian optimisation is this page's own: a Gaussian process with a squared-exponential kernel (length-scale 0.15 on the unit square, fixed, not fitted), standardised scores, expected improvement with ξ = 0.01, 3 random starting trials; its paths match a NumPy re-implementation step for step (recompute.py, src/check). Real searches would not see the surface in advance; here it is precomputed so every method reads the same numbers.
Most of this page's mistakes are shown where they happen (a tree without a depth limit, boosting without early stopping, one k-means start, reading clusters off t-SNE). Three are not:
Seven classifiers on the same 2-D data, two side by side. The shading is the model's probability of the blue class (for the SVMs, a squashed decision value); the solid line is where it decides; filled points are the 70% it was trained on, hollow points the 30% it never saw. Every model is this page's own code, written to do exactly what scikit-learn does (see the check line under the panels).
Reading this page: 25 minutes for the Reading tab plus 8 in closed details (230 words a minute, measured 24 October 2026), plus the lab. Times for other knowledge base pages are estimates from their word count and go stale as they are rebuilt.
Seven classifiers side by side on five 2-D datasets (one real), with training and test accuracy, support vectors, out-of-bag error and leaves. 10 min
The parent. Reading tab, "Beyond one network": classical ML at comparison level, beside contrastive learning and pre-transformer sequence models. Tab "When training goes wrong": symptoms, causes and fixes when a model will not learn (it absorbed the old Debugging training page). 30 min, plus 1 in closed details
MSE, cross entropy and the hinge loss; "One axis for every classification loss: the margin" (hinge against logistic against AdaBoost's exponential loss, and why exponential-loss boosting suffers under label noise). 28 min, plus 5 in closed details
Ridge, lasso and elastic net, the penalties behind section 1's regularised regressions and C in logistic regression and SVMs. 32 min, plus 8 in closed details
Newton's method and second-order optimisation, the step XGBoost takes in every leaf. 34 min, plus 14 in closed details
Precision and recall with rare positives (anomaly detection), calibration of a real naive Bayes model, error bars on a test-set score. 27 min, plus 7 in closed details
Gradients, Hessians and convexity: the maths under gradient boosting and the SVM's dual, with XGBoost's leaf weight and split gain worked by hand. 32 min
Nearest neighbours at scale: retrieval pipelines built on embeddings and approximate indexes. 21 min
HNSW, IVF, product quantisation and DiskANN step by step: the approximate nearest-neighbour indexes that make kNN fast. 30 min
Where learned embeddings come from, which is what makes kNN and clustering work on images and text. 31 min, plus 8 in closed details
Free book; the standard reference for everything on this page, with R and Python labs. about 15 h
Video playlists on trees, boosting, SVMs and PCA: the fastest intuition refreshers. about 6 h for those playlists
The second-order objective, leaf weights and split gain of section 3, from the source. about 25 min
Algorithm-by-algorithm reference with practical caveats; this page's models match its implementations. docs, about 1 h for the core pages
The deeper companion to ISLR: boosting as forward stagewise additive modelling, random forests' variance formula, SVMs and kernels. Free PDF. chapters 9, 10, 12, 15: about 8 h
The living version of section 4, by data size, split type and tuning budget; check the date. 15 min
The three inductive-bias experiments (smoothness, uninformative features, rotation). 1 h
The low-effective-dimension argument, with the original figures. 45 min
Live t-SNE runs showing what the plots do and do not mean. 20 min