danieldux commited on
Commit
52ea110
1 Parent(s): 04abc02

Refactored test cases and added new metrics

Browse files
Files changed (1) hide show
  1. tests.py +29 -10
tests.py CHANGED
@@ -1,17 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  test_cases = [
2
  {
3
- "predictions": [0, 0],
4
- "references": [1, 1],
5
- "result": {"metric_score": 0}
6
  },
7
  {
8
  "predictions": [1, 1],
9
  "references": [1, 1],
10
- "result": {"metric_score": 1}
 
 
 
 
 
11
  },
12
- {
13
- "predictions": [1, 0],
14
- "references": [1, 1],
15
- "result": {"metric_score": 0.5}
16
- }
17
- ]
 
1
+ # test_cases = [
2
+ # {
3
+ # "predictions": [0, 0],
4
+ # "references": [1, 1],
5
+ # "result": {"metric_score": 0}
6
+ # },
7
+ # {
8
+ # "predictions": [1, 1],
9
+ # "references": [1, 1],
10
+ # "result": {"metric_score": 1}
11
+ # },
12
+ # {
13
+ # "predictions": [1, 0],
14
+ # "references": [1, 1],
15
+ # "result": {"metric_score": 0.5}
16
+ # }
17
+ # ]
18
+
19
  test_cases = [
20
  {
21
+ "predictions": ["1111", "1113", "1120", "1211"],
22
+ "references": ["1111", "1112", "1113", "1114"],
23
+ "result": {"metric_score": 0},
24
  },
25
  {
26
  "predictions": [1, 1],
27
  "references": [1, 1],
28
+ "result": {
29
+ "accuracy": 0.25,
30
+ "hierarchical_precision": 0.7142857142857143,
31
+ "hierarchical_recall": 0.5,
32
+ "hierarchical_fmeasure": 0.588235294117647,
33
+ },
34
  },
35
+ # {"predictions": [1, 0], "references": [1, 1], "result": {"metric_score": 0.5}},
36
+ ]