danieldux commited on
Commit
667672b
1 Parent(s): a944252

Update hierarchical precision and recall values in tests.py

Browse files
Files changed (1) hide show
  1. tests.py +42 -20
tests.py CHANGED
@@ -10,12 +10,14 @@ test_cases = [
10
  "1111",
11
  "1111",
12
  "1111",
 
13
  ],
14
  "predictions": [
15
  "1111",
16
  "1112",
17
  "1120",
18
  "1211",
 
19
  "2111",
20
  "111",
21
  "11",
@@ -24,9 +26,9 @@ test_cases = [
24
  ],
25
  "result": {
26
  "accuracy": 0.1111111111111111,
27
- "hierarchical_precision": 0.2,
28
  "hierarchical_recall": 1.0,
29
- "hierarchical_fmeasure": 0.33333333333333337,
30
  },
31
  },
32
  {
@@ -44,9 +46,9 @@ test_cases = [
44
  "predictions": ["1112"],
45
  "result": {
46
  "accuracy": 0.0,
47
- "hierarchical_precision": 0.6,
48
- "hierarchical_recall": 0.6,
49
- "hierarchical_fmeasure": 0.6,
50
  },
51
  },
52
  {
@@ -54,9 +56,9 @@ test_cases = [
54
  "predictions": ["1120"],
55
  "result": {
56
  "accuracy": 0.0,
57
- "hierarchical_precision": 0.3,
58
- "hierarchical_recall": 0.3,
59
- "hierarchical_fmeasure": 0.3,
60
  },
61
  },
62
  {
@@ -69,14 +71,24 @@ test_cases = [
69
  "hierarchical_fmeasure": 0.25,
70
  },
71
  },
 
 
 
 
 
 
 
 
 
 
72
  {
73
  "references": ["1111"],
74
  "predictions": ["2111"],
75
  "result": {
76
  "accuracy": 0.0,
77
- "hierarchical_precision": 0.1,
78
- "hierarchical_recall": 0.1,
79
- "hierarchical_fmeasure": 0.10000000000000002,
80
  },
81
  },
82
  {
@@ -84,9 +96,9 @@ test_cases = [
84
  "predictions": ["111"],
85
  "result": {
86
  "accuracy": 0.0,
87
- "hierarchical_precision": 0.75,
88
- "hierarchical_recall": 0.3,
89
- "hierarchical_fmeasure": 0.4285714285714285,
90
  },
91
  },
92
  {
@@ -94,9 +106,9 @@ test_cases = [
94
  "predictions": ["11"],
95
  "result": {
96
  "accuracy": 0.0,
97
- "hierarchical_precision": 0.5,
98
- "hierarchical_recall": 0.2,
99
- "hierarchical_fmeasure": 0.28571428571428575,
100
  },
101
  },
102
  {
@@ -104,9 +116,19 @@ test_cases = [
104
  "predictions": ["1"],
105
  "result": {
106
  "accuracy": 0.0,
107
- "hierarchical_precision": 0.25,
108
- "hierarchical_recall": 0.1,
109
- "hierarchical_fmeasure": 0.14285714285714288,
 
 
 
 
 
 
 
 
 
 
110
  },
111
  },
112
  ]
 
10
  "1111",
11
  "1111",
12
  "1111",
13
+ "1111",
14
  ],
15
  "predictions": [
16
  "1111",
17
  "1112",
18
  "1120",
19
  "1211",
20
+ "1311",
21
  "2111",
22
  "111",
23
  "11",
 
26
  ],
27
  "result": {
28
  "accuracy": 0.1111111111111111,
29
+ "hierarchical_precision": 0.26666666666666666,
30
  "hierarchical_recall": 1.0,
31
+ "hierarchical_fmeasure": 0.4210526315789474,
32
  },
33
  },
34
  {
 
46
  "predictions": ["1112"],
47
  "result": {
48
  "accuracy": 0.0,
49
+ "hierarchical_precision": 0.75,
50
+ "hierarchical_recall": 0.75,
51
+ "hierarchical_fmeasure": 0.75,
52
  },
53
  },
54
  {
 
56
  "predictions": ["1120"],
57
  "result": {
58
  "accuracy": 0.0,
59
+ "hierarchical_precision": 0.5,
60
+ "hierarchical_recall": 0.5,
61
+ "hierarchical_fmeasure": 0.5,
62
  },
63
  },
64
  {
 
71
  "hierarchical_fmeasure": 0.25,
72
  },
73
  },
74
+ {
75
+ "references": ["1111"],
76
+ "predictions": ["1311"],
77
+ "result": {
78
+ "accuracy": 0.0,
79
+ "hierarchical_precision": 0.25,
80
+ "hierarchical_recall": 0.25,
81
+ "hierarchical_fmeasure": 0.25,
82
+ },
83
+ },
84
  {
85
  "references": ["1111"],
86
  "predictions": ["2111"],
87
  "result": {
88
  "accuracy": 0.0,
89
+ "hierarchical_precision": 0.0,
90
+ "hierarchical_recall": 0.0,
91
+ "hierarchical_fmeasure": 0,
92
  },
93
  },
94
  {
 
96
  "predictions": ["111"],
97
  "result": {
98
  "accuracy": 0.0,
99
+ "hierarchical_precision": 1.0,
100
+ "hierarchical_recall": 0.25,
101
+ "hierarchical_fmeasure": 0.4,
102
  },
103
  },
104
  {
 
106
  "predictions": ["11"],
107
  "result": {
108
  "accuracy": 0.0,
109
+ "hierarchical_precision": 1.0,
110
+ "hierarchical_recall": 0.25,
111
+ "hierarchical_fmeasure": 0.4,
112
  },
113
  },
114
  {
 
116
  "predictions": ["1"],
117
  "result": {
118
  "accuracy": 0.0,
119
+ "hierarchical_precision": 1.0,
120
+ "hierarchical_recall": 0.25,
121
+ "hierarchical_fmeasure": 0.4,
122
+ },
123
+ },
124
+ {
125
+ "references": ["1111"],
126
+ "predictions": ["9999"],
127
+ "result": {
128
+ "accuracy": 0.0,
129
+ "hierarchical_precision": 0.0,
130
+ "hierarchical_recall": 0.0,
131
+ "hierarchical_fmeasure": 0,
132
  },
133
  },
134
  ]