Update readme
Browse files
README.md
CHANGED
@@ -5,7 +5,7 @@ datasets:
|
|
5 |
tags:
|
6 |
- evaluate
|
7 |
- metric
|
8 |
-
description: "The ISCO-08 Hierarchical Accuracy Measure is an implementation of the measure described in [Functional Annotation of Genes Using Hierarchical Text Categorization](https://www.researchgate.net/publication/44046343_Functional_Annotation_of_Genes_Using_Hierarchical_Text_Categorization) (Kiritchenko, Svetlana and Famili, Fazel. 2005) applied
|
9 |
sdk: gradio
|
10 |
sdk_version: 3.19.1
|
11 |
app_file: app.py
|
@@ -16,58 +16,117 @@ pinned: false
|
|
16 |
|
17 |
## Metric Description
|
18 |
|
19 |
-
The
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
2
|
25 |
-
3
|
26 |
-
4
|
27 |
|
28 |
-
|
29 |
|
30 |
-
1.
|
31 |
-
2. The measure punishes distant errors more heavily:
|
32 |
-
1. the measure gives higher evaluation for correctly classifying one level down compared to staying at the parent node, e.g. classification into node $E$ (ISCO minor group "111") is better than classification into its parent $C$ (ISCO sub-major group "11") since $E$ is closer to the correct category $G$; and
|
33 |
-
2. the measure gives lower evaluation for incorrectly classifying one level down comparing to staying at the parent node, e.g. classification into node $F$ (ISCO unit group "1120") is worse than classification into its parent $C$ since $F$ is farther away from $G$.
|
34 |
|
35 |
-
|
36 |
|
37 |
-
|
38 |
|
39 |
-
|
40 |
-
`$hR = \frac{| \v{C}_i ∩ \v{C}^′_i|} {|\v{C}_i |} = \frac{1}{2}$`
|
41 |
|
42 |
-
|
43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44 |
|
45 |
## How to Use
|
|
|
46 |
*Give general statement of how to use the metric*
|
47 |
|
48 |
*Provide simplest possible example for using the metric*
|
49 |
|
|
|
|
|
50 |
### Inputs
|
|
|
51 |
*List all input arguments in the format below*
|
|
|
52 |
- **input_field** *(type): Definition of input, with explanation if necessary. State any default value(s).*
|
|
|
|
|
53 |
|
54 |
### Output Values
|
55 |
|
56 |
*Explain what this metric outputs and provide an example of what the metric output looks like. Modules should return a dictionary with one or multiple key-value pairs, e.g. {"bleu" : 6.02}*
|
57 |
|
58 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
59 |
|
60 |
#### Values from Popular Papers
|
|
|
61 |
*Give examples, preferrably with links to leaderboards or publications, to papers that have reported this metric, along with the values they have reported.*
|
62 |
|
|
|
|
|
63 |
### Examples
|
|
|
64 |
*Give code examples of the metric being used. Try to include examples that clear up any potential ambiguity left from the metric description above. If possible, provide a range of examples that show both typical and atypical results, as well as examples where a variety of input parameters are passed.*
|
65 |
|
|
|
|
|
66 |
## Limitations and Bias
|
|
|
67 |
*Note any known limitations or biases that the metric has, with links and references if possible.*
|
68 |
|
|
|
|
|
69 |
## Citation
|
|
|
70 |
*Cite the source where this metric was introduced.*
|
71 |
|
|
|
|
|
72 |
## Further References
|
|
|
73 |
*Add any useful further references.*
|
|
|
|
|
|
5 |
tags:
|
6 |
- evaluate
|
7 |
- metric
|
8 |
+
description: "The ISCO-08 Hierarchical Accuracy Measure is an implementation of the measure described in [Functional Annotation of Genes Using Hierarchical Text Categorization](https://www.researchgate.net/publication/44046343_Functional_Annotation_of_Genes_Using_Hierarchical_Text_Categorization) (Kiritchenko, Svetlana and Famili, Fazel. 2005) applied to the ISCO-08 classification scheme by the International Labour Organization."
|
9 |
sdk: gradio
|
10 |
sdk_version: 3.19.1
|
11 |
app_file: app.py
|
|
|
16 |
|
17 |
## Metric Description
|
18 |
|
19 |
+
The hierarchical structure of the ISCO-08 classification scheme, as depicted in the Figure 1, is organized into four levels, delineated by the specificity of their codes:
|
20 |
|
21 |
+
|Digits|Group level |
|
22 |
+
|--|--|
|
23 |
+
| 1-digit | Major groups |
|
24 |
+
| 2-digits | Sub-major groups |
|
25 |
+
| 3-digits | Minor groups |
|
26 |
+
| 4-digits | Unit groups |
|
27 |
|
28 |
+
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:
|
29 |
|
30 |
+
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.
|
|
|
|
|
|
|
31 |
|
32 |
+
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.
|
33 |
|
34 |
+
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.
|
35 |
|
36 |
+
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.
|
|
|
37 |
|
38 |
+
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.
|
39 |
+
|
40 |
+
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).
|
41 |
+
|
42 |
+
The measure applies a higher penalty for errors that occur between more distant categories within the hierarchy:
|
43 |
+
|
44 |
+
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.
|
45 |
+
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.
|
46 |
+
|
47 |
+
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).
|
48 |
+
|
49 |
+
The measure extends the concepts of precision and recall into a hierarchical context, introducing hierarchical precision ($hP$) and hierarchical recall ($hR$). 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.
|
50 |
+
|
51 |
+
To calculate the hierarchical measure, we extend the set of real classes $C_i = \{G\}$ with all ancestors of class $G:\vec{C}_i = \{B, C, E, G\}$.
|
52 |
+
|
53 |
+
We also extend the set of predicted classes $C^′_i = \{F\}$ with all ancestors of class $F : \vec{C}^′_i = \{C, F\}$.
|
54 |
+
|
55 |
+
So, class $C$ is the only correctly assigned label from the extended set:$| \vec{C}_i ∩ \vec{C}^′_i| = 1$.
|
56 |
+
|
57 |
+
There are $| \vec{C}^′_i| = 2$ assigned labels and $| \vec{C}_i| = 4$ real classes.
|
58 |
+
|
59 |
+
Therefore, we get:
|
60 |
+
|
61 |
+
$hP = \frac{| \vec{C}_i ∩ \vec{C}^′_i|} {|\vec{C}^′_i |} = \frac{1}{2}$
|
62 |
+
|
63 |
+
$hR = \frac{| \vec{C}_i ∩ \vec{C}^′_i|} {|\vec{C}_i |} = \frac{1}{2}$
|
64 |
+
|
65 |
+
We also can combine the two values $hP$ and $hR$ into one hF-measure:
|
66 |
+
|
67 |
+
$$
|
68 |
+
hF_β = \frac{(β^2 + 1) · hP · hR}{(β^2 · hP + hR)}, β ∈ [0, +∞)
|
69 |
+
$$
|
70 |
|
71 |
## How to Use
|
72 |
+
|
73 |
*Give general statement of how to use the metric*
|
74 |
|
75 |
*Provide simplest possible example for using the metric*
|
76 |
|
77 |
+
TBA
|
78 |
+
|
79 |
### Inputs
|
80 |
+
|
81 |
*List all input arguments in the format below*
|
82 |
+
|
83 |
- **input_field** *(type): Definition of input, with explanation if necessary. State any default value(s).*
|
84 |
+
- **references** *(List[str])*: List of reference ISCO-08 codes (true labels). This is the ground truth.
|
85 |
+
- **predictions** *(List[str])*: List of predicted ISCO-08 codes (predicted labels). This is the predicted classification or classification to compare against the ground truth.
|
86 |
|
87 |
### Output Values
|
88 |
|
89 |
*Explain what this metric outputs and provide an example of what the metric output looks like. Modules should return a dictionary with one or multiple key-value pairs, e.g. {"bleu" : 6.02}*
|
90 |
|
91 |
+
**Example output**:
|
92 |
+
|
93 |
+
```python
|
94 |
+
{
|
95 |
+
"accuracy": 0.25,
|
96 |
+
"hierarchical_precision": 1.0,
|
97 |
+
"hierarchical_recall": 0.4,
|
98 |
+
"hierarchical_fmeasure": 0.5714285714285715,
|
99 |
+
}
|
100 |
+
```
|
101 |
+
|
102 |
+
Values are decimal numbers between 0 and 1. Higher scores are better.
|
103 |
|
104 |
#### Values from Popular Papers
|
105 |
+
|
106 |
*Give examples, preferrably with links to leaderboards or publications, to papers that have reported this metric, along with the values they have reported.*
|
107 |
|
108 |
+
TBA
|
109 |
+
|
110 |
### Examples
|
111 |
+
|
112 |
*Give code examples of the metric being used. Try to include examples that clear up any potential ambiguity left from the metric description above. If possible, provide a range of examples that show both typical and atypical results, as well as examples where a variety of input parameters are passed.*
|
113 |
|
114 |
+
TBA
|
115 |
+
|
116 |
## Limitations and Bias
|
117 |
+
|
118 |
*Note any known limitations or biases that the metric has, with links and references if possible.*
|
119 |
|
120 |
+
TBA
|
121 |
+
|
122 |
## Citation
|
123 |
+
|
124 |
*Cite the source where this metric was introduced.*
|
125 |
|
126 |
+
TBA
|
127 |
+
|
128 |
## Further References
|
129 |
+
|
130 |
*Add any useful further references.*
|
131 |
+
|
132 |
+
TBA
|