Metric: isco_hierarchical_accuracy

The ISCO-08 Hierarchical Accuracy Measure is an implementation of the measure described in Functional Annotation of Genes Using Hierarchical Text Categorization (Kiritchenko, Svetlana and Famili, Fazel. 2005) and adapted for the ISCO-08 classification scheme by the International Labour Organization.

The measure rewards more precise classifications that correctly identify an occupation's placement down to the specific Unit group level and applies penalties for misclassifications based on the hierarchical distance between the correct and assigned categories.

ISCO codes must be wrapped in double quotes.

data

data
"1111"
"1111"
Examples

Metric Card for ISCO-08 Hierarchical Accuracy Measure

Metric Description

ISCO‑08 is a four‑level taxonomy (Table 1). Correctly locating an occupation at the appropriate level—Major, Sub‑major, Minor or Unit—is essential, yet many practical systems make small but still useful errors (e.g. confusing two Unit groups within the same Minor group). The present metric extends classical precision, recall and F‑measure to this hierarchical setting, thereby providing a more nuanced assessment than flat accuracy.

Digits Group level
1-digit Major groups
2-digits Sub-major groups
3-digits Minor groups
4-digits Unit groups

In this context, the hierarchical accuracy measure is specifically designed to evaluate classifications within this structured framework. It emphasizes the importance of precision in classifying occupations at the correct level of specificity:

  1. Major Groups (1-digit codes): The broadest category that encompasses a wide range of occupations grouped based on their fundamental characteristic and role in the job market. Misclassification among different Major groups implies a fundamental misunderstanding of the occupational role.

  2. Sub-major Groups (2-digit codes): Provide a more detailed classification within each Major group, delineating categories that share specific occupational characteristics. Errors within a Major group but across different Sub-major groups are less severe than those across Major groups but are still significant due to the deviation from the correct occupational category.

  3. Minor Groups (3-digit codes): Offer further granularity within Sub-major groups, classifying occupations that require similar skill sets and qualifications. Misclassifications within a Sub-major group but across different Minor groups are penalized, yet to a lesser extent than errors across Sub-major or Major groups, as they still fall within a broader correct occupational category.

  4. Unit Groups (4-digit codes): The most specific level, identifying precise occupations. Misclassification within a Minor group, between different Unit groups, represents the least severe error, as it occurs within the context of closely related occupations.

The hierarchical accuracy measure rewards more precise classifications that correctly identify an occupation's placement down to the specific Unit group level and applies penalties for misclassifications based on the hierarchical distance between the correct and assigned categories. This approach allows for a refined evaluation of classification systems, acknowledging partially correct classifications while penalizing inaccuracies more severely as they deviate further from the correct level in the hierarchical structure.

For example, a misclassification into Unit group 2211 (Generalist Medical Practitioners) when the correct category is Unit group 2212 (Specialist Medical Practitioners) should incur a lesser penalty than misclassification into Unit group 2352 (Special Needs Teachers), as Unit groups 2211 and 2212 are within the same Minor group 221 (Medical doctors) and share a closer hierarchical relationship compared to Minor group 235 (Other teaching professionals) which is in a different Sub-major group (23 Teaching professionals).

The measure applies a higher penalty for errors that occur between more distant categories within the hierarchy:

  1. Correct classifications at a more specific level (e.g., Minor group 2211) are evaluated more favorably than classifications at a more general level within the same hierarchy (e.g., Sub-major group 22), since the former indicates a closer match to the correct category.
  2. Conversely, incorrect classifications at a more specific level are penalized more heavily than those at a more general level. For instance, classifying into Minor group 222 (Nursing and Midwifery Professionals) is considered worse than classifying into its parent category, Sub-major group 22, if the correct classification is Minor group 221, because the incorrect specific classification indicates a farther deviation from the correct category.

Misclassification among sibling categories (e.g., between different Minor groups within the same Sub-major group) is less severe than misclassification at a higher hierarchical level (e.g., between different Major groups).

The measure extends the concepts of precision and recall into a hierarchical context, introducing hierarchical precision (ℎ𝑃) and hierarchical recall (ℎ𝑅). In this framework, each sample belongs not only to its designated class but also to all ancestor categories in the hierarchy, excluding the root (we exclude the root of the graph, since all samples belong to the root by default). This adjustment allows the measure to account for the hierarchical structure of the classification scheme, rewarding more accurate location of a sample within the hierarchy and penalizing errors based on their hierarchical significance.

To calculate the hierarchical measure, extend the set of real classes

$$C_i = \{G\}$$

with all ancestors of 𝐺:

$$\vec{C}_i = \{B, C, E, G\}$$

Similarly, extend the set of predicted classes

$$C^′_i = \{F\}$$

with all ancestors of 𝐹:

$$\vec{C}^′_i = \{C, F\}$$

Class 𝐶 is the only correctly assigned label from the extended sets:

$$| \vec{C}_i ∩ \vec{C}^′_i| = 1$$

There are

$$| \vec{C}^′_i| = 2$$

predicted labels and

$$| \vec{C}_i| = 4$$

real classes.

Therefore,

$$hP = \frac{| \vec{C}_i ∩ \vec{C}^′_i|} {|\vec{C}^′_i |} = \frac{1}{2}$$

$$hR = \frac{| \vec{C}_i ∩ \vec{C}^′_i|} {|\vec{C}_i |} = \frac{1}{2}$$

Finally, combine ℎ𝑃 and ℎ𝑅 into the hierarchical 𝐹-measure:

$$hF_β = \frac{(β^2 + 1) · hP · hR}{(β^2 · hP + hR)}, β ∈ [0, +∞)$$

The metric rewards depth: predicting 221 instead of 22 yields higher hF because more ancestors overlap. It penalises distance: predicting a Unit in a different Sub‑major group incurs a larger loss than confusing two Units under the same Minor group.

How to Use

  • Model evaluation Assess neural or rule‑based classifiers that map free‑text occupation descriptions to ISCO‑08 codes.
  • Inter‑rater agreement Quantify consistency between human coders when full agreement at the Unit level is not always expected.

Inputs

  • references (List[str]): List of reference ISCO-08 codes (true labels). This is the ground truth.
  • predictions (List[str]): List of predicted ISCO-08 codes (predicted labels). This is the predicted classification or classification to compare against the ground truth.

Output Values

Example output:

{
    "accuracy": 0.25,
    "hierarchical_precision": 1.0,
    "hierarchical_recall": 0.4,
    "hierarchical_fmeasure": 0.5714285714285715,
}

Values are decimal numbers between 0 and 1. Higher scores are better.

Values from Popular Papers

The following table is from the paper Improving Parental Occupation Coding Procedures with AI.

Summary of multilingual model overall accuracies and hF-measure scores

Model name Training dataset (training & validation splits) Evaluation dataset (test split) Accuracy hFβ
Model 1 ICILS ICILS 63% 0.89
Model 2 ILO ILO 92% 0.99
Model 2 ILO ICILS 36% 0.94
Model 3 ICILS+ILO ICILS+ILO 80% 0.93
Model 3 ICILS+ILO ICILS 62% 0.95

Examples

def compute_metrics(p: EvalPrediction):
    preds = p.predictions[0] if isinstance(p.predictions, tuple) else p.predictions
    preds = np.argmax(preds, axis=1)
    # Use labels instead of ids for hierarchical ISCO-08 classification
    preds = [model.config.id2label[p] for p in preds]
    refs = [model.config.id2label[r] for r in p.label_ids]
    result = metric.compute(predictions=preds, references=refs)
    return result

Limitations and Bias

No known limitations or bias.

Citation

This metric was developed as part of an IEA R&D project, Improving Parental Occupation Coding Procedures with AI (Duckworth et al, 2024). The metric was used to evaluate the multilingual ICILS XLM-R ISCO classification model.

Further References