Skip to content

Commit c9f4d59

Browse files
committed
WIP - making the v8 feature encoder test suite work with new v8 FeatureEncoder and StringTable# Please enter the commit message for your changes. Lines starting
1 parent cf690b6 commit c9f4d59

File tree

109 files changed

+1174
-1447
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1174
-1447
lines changed
-45.5 KB
Binary file not shown.
-25.2 KB
Binary file not shown.
-61.1 KB
Binary file not shown.
-45.8 KB
Binary file not shown.

improveai-android/src/androidTest/assets/feature_encoder_test_suite/big_float.json

-13
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
22
"test_case": {
3-
"variant": -2147483647
4-
},
5-
"test_output": {
6-
"5e9f9c59": -2147498200.0
3+
"item": -2147483647
74
},
5+
"test_output": [-2147498200.0],
86
"model_seed": 1,
9-
"noise": 0.8928601514360016,
10-
"variant_seed": 2675988294294598568,
11-
"value_seed": 6818340268807889528,
12-
"givens_seed": 12461487462738526788
7+
"feature_names": ["item"],
8+
"string_tables": {},
9+
"noise": 0.8928601514360016
1310
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
22
"test_case": {
3-
"variant": 2147483647
4-
},
5-
"test_output": {
6-
"5e9f9c59": 2147498200.0
3+
"item": 2147483647
74
},
5+
"test_output": [2147498200.0],
86
"model_seed": 1,
9-
"noise": 0.8928601514360016,
10-
"variant_seed": 2675988294294598568,
11-
"value_seed": 6818340268807889528,
12-
"givens_seed": 12461487462738526788
7+
"feature_names": ["item"],
8+
"string_tables": {},
9+
"noise": 0.8928601514360016
1310
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"test_case": {
3+
"item": -1.7976931348623157e+308
4+
},
5+
"test_output": ["-inf"],
6+
"model_seed": 1,
7+
"feature_names": ["item"],
8+
"string_tables": {},
9+
"noise": 0.8928601514360016
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"test_case": {
3+
"item": -1.7976931348623157e+308
4+
},
5+
"test_output": [-1.7976931348623157e+308],
6+
"model_seed": 1,
7+
"feature_names": ["item"],
8+
"string_tables": {},
9+
"noise": 0.0
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"test_case": {
3+
"item": 1.7976931348623157e+308
4+
},
5+
"test_output": ["inf"],
6+
"model_seed": 1,
7+
"feature_names": ["item"],
8+
"string_tables": {},
9+
"noise": 0.8928601514360016
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"test_case": {
3+
"item": 1.7976931348623157e+308
4+
},
5+
"test_output": [1.79769313e+308],
6+
"model_seed": 1,
7+
"feature_names": ["item"],
8+
"string_tables": {},
9+
"noise": 0.0
10+
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
22
"test_case": {
3-
"variant": false
4-
},
5-
"test_output": {
6-
"5e9f9c59": 6.812029e-06
3+
"item": false
74
},
5+
"test_output": [1.60150026e-43],
86
"model_seed": 1,
9-
"noise": 0.8928601514360016,
10-
"variant_seed": 2675988294294598568,
11-
"value_seed": 6818340268807889528,
12-
"givens_seed": 12461487462738526788
7+
"feature_names": ["item"],
8+
"string_tables": {},
9+
"noise": 0.8928601514360016
1310
}
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
{
22
"test_case": {
3-
"variant": true
4-
},
5-
"test_output": {
6-
"5e9f9c59": 1.0000136
3+
"item": true
74
},
5+
"test_output": [1.00000681],
86
"model_seed": 1,
9-
"noise": 0.8928601514360016,
10-
"variant_seed": 2675988294294598568,
11-
"value_seed": 6818340268807889528,
12-
"givens_seed": 12461487462738526788
7+
"feature_names": ["item"],
8+
"string_tables": {},
9+
"noise": 0.8928601514360016
1310
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"test_case": {
3+
"items": [null, null, null, null, null, null],
4+
"contexts": ["a", "b", "c", "fxlal", "uvddh", "zbwmy"]
5+
},
6+
"test_output": [
7+
[-1.0, null], [-0.6666666666666667, null], [-0.33333333333333337, null],
8+
[-1.0, null], [-0.6666666666666667, null], [-0.33333333333333337, null]],
9+
"model_seed": 29306437,
10+
"feature_names": ["context", "item"],
11+
"string_tables": {"context": [14, 3, 5, 4, 11, 7, 8]},
12+
"noise": 0.0
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"test_case": {
3+
"items": ["a", "b", "c", "xoyrf", "ymbgh", "lsxca"],
4+
"contexts": ["a", "b", "c", "fxlal", "uvddh", "zbwmy"]
5+
},
6+
"test_output": [
7+
[-1.0, 1.0], [-0.6666666666666667, 0.6666666666666667], [-0.33333333333333337, 0.0],
8+
[-1.0, 1.0], [-0.6666666666666667, 0.6666666666666667], [-0.33333333333333337, 0.0]],
9+
"model_seed": 29306437,
10+
"feature_names": ["context", "item"],
11+
"string_tables": {"context": [14, 3, 5, 4, 11, 7, 8], "item": [8, 7, 3, 11, 5, 14, 4]},
12+
"noise": 0.0
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"test_case": {
3+
"items": ["a", "b", "c", "dzsys", "pasdy", "atoat"]
4+
},
5+
"test_output": [[1.0], [0.6666666666666667], [0.0], [1.0], [0.6666666666666667], [0.0]],
6+
"model_seed": 4255466980,
7+
"feature_names": ["item"],
8+
"string_tables": {"item": [124, 9, 73, 40, 54, 110, 67]},
9+
"noise": 0.0
10+
}
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
11
{
22
"test_case": {
3-
"variant": {
4-
"$value": {
3+
"item": {
54
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000": "foo",
65
"\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001": "bar"
7-
}
86
}
97
},
10-
"test_output": {
11-
"8946516b": 11509.078,
12-
"055ae894": 26103.178,
13-
"4bfbc00e": -19661.135,
14-
"463cc537": -13292.091
15-
},
16-
"model_seed": 1,
17-
"noise": 0.8928601514360016,
18-
"variant_seed": 2675988294294598568,
19-
"value_seed": 6818340268807889528,
20-
"givens_seed": 12461487462738526788
8+
"test_output": [1.0, 1.0],
9+
"model_seed": 2,
10+
"feature_names": ["item.\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000", "item.\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001"],
11+
"string_tables": {"item.\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000": [1], "item.\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001": [1]},
12+
"noise": 0.0
2113
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"test_case": {
3+
"item": {
4+
"0": "foo",
5+
"1": "bar"
6+
}
7+
},
8+
"test_output": [1.0, 1.0],
9+
"model_seed": 2,
10+
"feature_names": ["item.0", "item.1"],
11+
"string_tables": {"item.0": [1], "item.1": [1]},
12+
"noise": 0.0
13+
}
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
{
22
"test_case": {
3-
"givens": {},
4-
"variant": {}
3+
"context": {},
4+
"item": {}
55
},
6-
"test_output": {},
6+
"test_output": [null],
77
"model_seed": 1,
8-
"noise": 0.8928601514360016,
9-
"variant_seed": 2675988294294598568,
10-
"value_seed": 6818340268807889528,
11-
"givens_seed": 12461487462738526788
8+
"feature_names": ["item"],
9+
"string_tables": {},
10+
"noise": 0.8928601514360016
1211
}
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"test_case": {
3-
"variant": []
3+
"item": []
44
},
5-
"test_output": {},
5+
"test_output": [null],
66
"model_seed": 1,
7-
"noise": 0.8928601514360016,
8-
"variant_seed": 2675988294294598568,
9-
"value_seed": 6818340268807889528,
10-
"givens_seed": 12461487462738526788
7+
"feature_names": ["item"],
8+
"string_tables": {},
9+
"noise": 0.8928601514360016
1110
}
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"test_case": {
3-
"variant": {
3+
"item": {
44
"text": "lovely corgi",
55
"chars": 12,
66
"words": 2
77
},
8-
"givens": {
8+
"context": {
99
"given_0": 0.0,
1010
"given_1": [
1111
0,
@@ -16,36 +16,11 @@
1616
"0": 0.0,
1717
"1": "dummy_str"
1818
}
19-
},
20-
"extra_features": {
21-
"timestamp": 1625178668.87
22-
},
23-
"feature_names": [
24-
"1c1de8c1",
25-
"02588087",
26-
"291ec7b3",
27-
"51fa8142",
28-
"5cd66872",
29-
"a01c7050",
30-
"c3abcfc3",
31-
"dummy000",
32-
"timestamp"
33-
]
19+
}
3420
},
35-
"test_output": [
36-
29437.201,
37-
NaN,
38-
22238.152,
39-
NaN,
40-
NaN,
41-
NaN,
42-
2.0000205,
43-
NaN,
44-
1625178600.0
45-
],
21+
"test_output": [1.5974802e-43, 1.5974802e-43, 1.0000068e+00, 2.0000136e+00, 1.5974802e-43, 1.0000068e+00, 1.0000068e+00, 1.2000082e+01, 2.0000136e+00],
4622
"model_seed": 1,
47-
"noise": 0.8928601514360016,
48-
"variant_seed": 2675988294294598568,
49-
"value_seed": 6818340268807889528,
50-
"givens_seed": 12461487462738526788
23+
"feature_names": ["context.given_0", "context.given_1.0", "context.given_1.1", "context.given_1.2", "context.given_2.0", "context.given_2.1", "item.text", "item.chars", "item.words"],
24+
"string_tables": {"item.text": [1], "context.given_2.1": [1]},
25+
"noise": 0.8928601514360016
5126
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"test_case": {
3+
"item": {"a": null, "d": null, "e": null}
4+
},
5+
"test_output": [null, null, null, null, null],
6+
"model_seed": 1,
7+
"feature_names": ["item.a", "item.b", "item.c", "item.d", "item.e"],
8+
"string_tables": {},
9+
"noise": 0.8928601514360016
10+
}

0 commit comments

Comments
 (0)