Interactive maps of nested dichotomies for multiclass classification
A nested dichotomy (ND) reduces an M-class classification problem to a binary tree of two-class problems. Each internal node partitions its classes into two groups and fits a binary classifier to separate them, and the probability of a class is the product of the branch probabilities on the path from the root to its leaf. For M classes there are (2M−3)!! NDs, 945 for M = 6 and 10,395 for M = 7, and each is a different model of the same data.
ndscape places every ND for a given M on a two-dimensional map. Each ND is encoded as depth-weighted structural tokens, the L2-normalised token counts are compared by cosine similarity, and metric multidimensional scaling places the NDs so that Euclidean distance on the map approximates the chord distance between their token vectors. The map depends only on ND structure, so it is fixed for each M and any score can be shown on it.
The maps below are from ndscape: a structural map of the nested dichotomy space (Dix-Matthews, Hodkiewicz and Polpo, 2026). On six UCI datasets the colour shows test accuracy or bootstrap prediction variance, and in simulations with a known generating ND it shows squared bias or variance. Hovering over a point gives its scores and clicking it gives its structure.
As of October 2026, ndscape is the only package on PyPI for nested dichotomies, and it takes any scikit-learn classifier with predict_proba as the binary classifier. NDs are otherwise available in Weka's nestedDichotomies package (Java), in the R package nestedLogit, and as research code in v-melnikov/nested-dichotomies, which has no package metadata and is used by copying it into a project. The code is on GitHub and PyPI (pip install ndscape), and the data and map coordinates are archived on Zenodo. The tutorial maps, scores and selects NDs on two 6-class datasets.