AI Glossary / AI and machine learning / Intermediate
Hierarchical Classification
Definition
Hierarchical Classification is classification into a taxonomy of categories that sit inside one another, where a prediction can name a broad class, a narrower subclass or both, respecting the tree of categories.
What it means
Many business category systems are not flat lists but trees: expense accounts roll up into cost centers, products sit inside ranges inside departments, incidents belong to types inside families. Hierarchical classification works with that tree instead of flattening it away.
Working with the tree buys two things. Predictions can stop at the level the evidence supports, saying office supplies when the exact sub-account is unclear, and errors can be judged by distance: confusing two pens is a small miss, confusing stationery with vehicles is a large one.
The hierarchy also shares strength. Rare leaf categories, too sparse to learn alone, borrow from their siblings because the model first learns the parent class that has plenty of examples.
Flattening, the common shortcut, loses all of this: the model must choose among hundreds of leaves with no notion that some mistakes are near-misses and others are absurdities.
For a business, hierarchical classification is how categorization should work wherever a chart of accounts, product taxonomy or incident taxonomy already exists, which is nearly everywhere; the taxonomy you already govern becomes part of the model.
How it works
Formalize the existing taxonomy as a tree of classes, cleaning up orphans and ambiguous placements first.
Train classifiers that respect the tree: either one model per node, deciding among children, or a single model whose error costs reflect tree distance.
Allow predictions at internal nodes when leaf-level confidence is low, so the system says less rather than guessing wrong.
Score errors with tree distance, so a sibling confusion counts as minor and a cross-tree confusion counts as serious.
Monitor per-level accuracy: many systems are excellent at the top of the tree and poor at the leaves, which is still useful if the leaves route to humans.
Three practical examples
- An expense system coding receipts to the right account and sub-account, falling back to the parent account when the receipt is ambiguous.
- A support tool routing tickets first to a product family, then a product, then a component, handing to humans below its confidence level.
- A retailer classifying new products into department, range and line, with rare lines borrowing strength from their range.
Think of it this way
Think of a librarian shelving books. First the right floor, then the right room, then the right shelf; and a librarian who is unsure of the shelf still gets the book to the right room, where it can be found. Hierarchical classification works the same way: certainty is spent where it exists.
The limit: a book miscatalogued at the floor level is lost, however perfect the shelving below it. Errors high in the tree are the expensive ones, which is exactly why the scoring should punish them most.
Worked example
routing tickets down the tree
Suppose a software firm receives 4,000 tickets a month across 9 product families and 140 components. The figures are illustrative.
A flat classifier choosing among 140 components reaches 58 per cent accuracy; a hierarchical one reaches 91 per cent at family level and routes two thirds of tickets correctly to component level.
The remaining third arrive with the right family and a confidence flag, so a human finishes the routing in seconds rather than from scratch.
Misroutes also got cheaper: the rare errors now confuse sibling components, not unrelated families, so rework stays within the same team.
Illustrative case study
A fictional insurer flattened its claims taxonomy into 300 leaf classes for a new model, and the launch review celebrated 70 per cent accuracy.
Operations found the errors were not random: the model regularly confused motor with property claims, absurdities a hierarchy-aware model would have been punished for in training.
The invented lesson: in a tree of categories, some mistakes are typos and some are filing a car in the ocean. Score them differently or your model will not know the difference.
Common misconceptions and mistakes
- Flat classification is simpler and just as good. It is simpler, and it throws away structure that improves accuracy, error costs and learning on rare classes.
- Partial predictions are failures. A confident parent-class answer with an honest uncertainty flag is often more useful than a confident wrong leaf.
- You need a special taxonomy built for AI. The taxonomy your business already governs is usually the right one; the model should adapt to it, not the reverse.
Business use
Map your real taxonomy before modeling: classification quality will be capped by the taxonomy's cleanliness.
Report accuracy per tree level, not one flat number, so partial usefulness is visible.
Route low-confidence leaf decisions to humans with the parent class attached; that is where hierarchy pays its daily wage.
People also ask
What is the difference from ordinary multi-class classification?
The classes form a tree, and the model can predict internal nodes, share learning across siblings and be scored by tree distance.
When is it worth the extra structure?
Whenever the business already thinks in a taxonomy: accounts, products, incidents, documents, skills.
How are errors scored?
By distance in the tree: sibling confusions are cheap, distant confusions expensive, so training and evaluation push toward meaningful mistakes.
Check your understanding
Why can a hierarchical classifier say office supplies without choosing a sub-account?
Answer: Because the taxonomy lets it commit at the level the evidence supports, and a correct parent-class answer beats a guessed wrong leaf for both trust and downstream routing.
Related terms
- Taxonomy
- Multi-class classification
- Hierarchical clustering
- confidence threshold
- error cost
- routing
Learn next
AI for Business Owners covers how to judge whether a model's errors are the cheap kind or the expensive kind: https://aiforbusinessandlife.com/academy/ai-for-business-owners. [C2]
More in AI and machine learning
- Hidden Markov Model with Duration - A Hidden Markov Model with Duration is a sequence model that extends the classic hidden Markov model by explicitly modeling how long the system stays in...
- Hidden Markov random field - A Hidden Markov random field is a model for data arranged in a grid or network, most often images, where hidden labels at each location depend on their...
- Hidden Markov Segment Model - A Hidden Markov Segment Model is a sequence model that treats observations as arriving in variable-length segments, each generated as a unit by one hidden...
- Hierarchical control system - A hierarchical control system organizes control responsibilities into levels, with higher levels setting broader goals and lower levels handling more...
- Hierarchical navigable small world - Hierarchical navigable small world, usually abbreviated HNSW, is a graph-based method for approximate nearest-neighbor search.
- Highway network - A highway network is a neural-network architecture that uses learned gates to control how information is transformed or carried through layers.
Sources
[S22] Berkeley BOP, Artificial Intelligence Ontology (aio.owl). Full URLs are in the source ledger. Verified 11 October 2026.
Previous: Hierarchical Bayesian model Next: Hierarchical clustering