danieldux commited on
Commit
51d386c
·
1 Parent(s): 667672b

Update ISCO-08 Hierarchical Accuracy Measure implementation

Browse files
Files changed (1) hide show
  1. isco_hierarchical_accuracy.py +8 -12
isco_hierarchical_accuracy.py CHANGED
@@ -38,6 +38,9 @@ _CITATION = """
38
 
39
  _DESCRIPTION = """
40
  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) and adapted for the ISCO-08 classification scheme by the International Labour Organization.
 
 
 
41
  """
42
 
43
  _KWARGS_DESCRIPTION = """
@@ -56,13 +59,13 @@ Examples:
56
  Example 1
57
 
58
  >>> ham = evaluate.load("danieldux/isco_hierarchical_accuracy")
59
- >>> results = ham.compute(reference=["1111", "1112", "1113", "1114"], predictions=["1111", "1113", "1120", "1211"])
60
  >>> print(results)
61
  {
62
- 'accuracy': 0.25,
63
- 'hierarchical_precision': 0.7142857142857143,
64
- 'hierarchical_recall': 0.5,
65
- 'hierarchical_fmeasure': 0.588235294117647
66
  }
67
  """
68
 
@@ -87,13 +90,6 @@ class ISCO_Hierarchical_Accuracy(evaluate.Metric):
87
  description=_DESCRIPTION,
88
  citation=_CITATION,
89
  inputs_description=_KWARGS_DESCRIPTION,
90
- # This defines the format of each prediction and reference
91
- # features=datasets.Features(
92
- # {
93
- # "predictions": datasets.Value("string"),
94
- # "references": datasets.Value("string"),
95
- # }
96
- # ),
97
  features=datasets.Features(
98
  {
99
  "references": datasets.Sequence(datasets.Value("string")),
 
38
 
39
  _DESCRIPTION = """
40
  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) and adapted for the ISCO-08 classification scheme by the International Labour Organization.
41
+
42
+ 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.
43
+
44
  """
45
 
46
  _KWARGS_DESCRIPTION = """
 
59
  Example 1
60
 
61
  >>> ham = evaluate.load("danieldux/isco_hierarchical_accuracy")
62
+ >>> results = ham.compute(reference=["1111", "1112", "1113", "1114", "1120"], predictions=["1111", "1113", "1120", "1211", "2111"])
63
  >>> print(results)
64
  {
65
+ "accuracy": 0.2,
66
+ "hierarchical_precision": 0.5,
67
+ "hierarchical_recall": 0.7777777777777778,
68
+ "hierarchical_fmeasure": 0.6086956521739131,
69
  }
70
  """
71
 
 
90
  description=_DESCRIPTION,
91
  citation=_CITATION,
92
  inputs_description=_KWARGS_DESCRIPTION,
 
 
 
 
 
 
 
93
  features=datasets.Features(
94
  {
95
  "references": datasets.Sequence(datasets.Value("string")),