﻿# TabICL many-class prediction: hierarchical probabilities need local-to-global label mapping

Trace TabICL hierarchical classification beyond a checkpoint’s native class width, preserving node labels, group probabilities and the final global class order.

Author: Retrivium editorial team
Updated: 2026-11-04
Canonical URL: https://retrivium.ai/journal/fg2-tabicl-hierarchical-classes-local-global-probability-mapping/
Language: en

## Distinguish native output width from composed support

A classifier checkpoint has a native class configuration, while a wrapper can support a larger label space through additional computation. The [TabICL model contract](https://raw.githubusercontent.com/soda-inria/tabicl/main/src/tabicl/_model/tabicl.py) describes hierarchical handling when the dataset exceeds native class support. Preserve that distinction before estimating cost or interpreting logits. A larger accepted label vocabulary does not prove that the pretrained final projection directly contains an independent output channel for every application class.

## Follow group and leaf predictions separately

The [in-context learning implementation](https://raw.githubusercontent.com/soda-inria/tabicl/main/src/tabicl/_model/learning.py) traverses a classification tree. Internal nodes predict groups, while leaves classify within their assigned subsets. These are different conditional problems using node-specific context. A port should preserve which labeled examples and local encodings belong to each node. Treating every node's output as a flat global probability vector can produce plausible dimensions while combining incompatible class meanings.

## Preserve the probability composition

The implementation combines child probabilities with group probabilities using the hierarchy's probability relationship. It maps local leaf classes back into the global label space. The [project guide](https://raw.githubusercontent.com/soda-inria/tabicl/main/README.md) supplies the selected release context. Keep tree construction, class ordering and relevant inference settings with the model. A change to those components can alter predictions even when the reusable neural checkpoint remains the same.

## Keep class IDs separate from numerical quantities

Class identifiers define membership and output order; their integer values do not establish a target-space distance. The [TabPFN schema guide](/journal/fg2-tabpfn-categorical-numeric-text-schema-boundary/) provides related representation reasoning. Verify that label encoding is inverted consistently at every boundary, particularly when a subset lacks some global classes. Returning a row of probabilities is insufficient if its columns are attached to the wrong external labels.

## Test hierarchy boundaries and calibration

Use examples around a native-width boundary, inspect probability normalization and verify each global label's column. Measure task quality and calibration after the complete composition, not only at leaves. The [TabICL architecture guide](/journal/fg2-tabicl-column-row-dataset-attention-stages/) explains the broader pipeline. A useful result reports the hierarchical procedure and its resource cost, preserving the difference between native checkpoint capacity, wrapper-level label support and measured prediction quality on a particular many-class application.
