A logistic-regression classifier only knows how to separate two classes: score f(x) = wยทx + b, predicted class = sign(f(x)). Real problems usually have K > 2 classes, so the binary classifier has to be reused in one of two standard ways:
One-vs-Rest (OvR)
train K classifiers: f_k(x) = w_kยทx + b_k
each f_k trained on "class k" vs "everyone else"
predict: argmax_k f_k(x)
One-vs-One (OvO)
train C(K,2) = K(K-1)/2 classifiers, one per class pair (i,j)
each f_ij trained only on points from i and j
predict: every f_ij casts one vote for i or j
class with the most votes wins
- OvR trains fewer classifiers (K), but each one sees a lopsided dataset โ one class against all the others combined โ which can distort its boundary.
- OvO trains far more classifiers as K grows (quadratically), but each sees a small, cleanly separable two-class problem and votes are usually decisive.
- The vote margin readout is the gap between the winning class's score (OvR) or vote count (OvO) and the runner-up โ a small margin means the grid cell sits right on a decision boundary, which is exactly where a real classifier is most likely to misfire on new data.
- Every classifier here is trained live with real batch gradient descent on the logistic loss โ this is not a lookup table, dragging the spread slider or resampling the dataset genuinely retrains all classifiers.
- The main view is a 2D isometric projection of the same confidence landscape the 3D version renders with WebGL: bar height still encodes vote margin, bar color still encodes predicted class. Drag inside it to rotate/tilt โ the projection math (rotate by yaw, tilt by pitch, orthographic project) runs on the 2D canvas every frame, with inertia after release. The strip below is a flat top-down heatmap of the same grid for a quick at-a-glance read.
Real-world relevance: scikit-learn's OneVsRestClassifier and OneVsOneClassifier wrap exactly this logic around any binary classifier (logistic regression, linear SVM, โฆ) to make it handle more than two classes.