Skip to content

Commit 7ef7428

Browse files
authored
fix: add missing numericAttributes/categoricalAttributes fields (#54)
1 parent 14bc626 commit 7ef7428

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

ufc/bandit-tests/test-case-car-bandit.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
{
66
"comment": "Tests that probability floor is applied. These actions shuffle to: Mercedes, Dodge, Toyota. Without minimum probability floors, Toyota gets most of the weight, and that's what gets assigned. However, with a probability floor, the other actions each get a non-trivial shard range, so it is not assigned. If the probability floor is not normalized (divided by the number of actions), then the first action, Mercedes, will be assigned too many shards and get assigned. Only when it's non-zero and normalized does Anastasia get correctly assigned the middle action: Dodge.",
77
"subjectKey": "anastasia",
8-
"subjectAttributes": {},
8+
"subjectAttributes": {
9+
"numericAttributes": {},
10+
"categoricalAttributes": {}
11+
},
912
"actions": [
1013
{
1114
"actionKey": "dodge",
@@ -28,7 +31,10 @@
2831
{
2932
"comment": "Tests that default action scores are applied and top-scoring actions are tie-broken by name. These actions shuffle to: Toyota, Honda, Ford. If the default action score is ignored and the unknown (non-Toyota) actions get scored 0, Toyota takes up too many shards and that is what is assigned. With the default score at play, the two unknown actions are top-scoring and get most of the shards. However, because of the top scoring action weight of 1 - all other action weights, the top scoring action gets the most. When not tie-broken, implementations like JavaScript that iterate over them in order would declare Honda the top-scoring action, and it would end up getting assigned. However, when breaking ties by action name, Ford takes the prize and gets assigned. Thus, for this test to pass with Ford being assigned to Bob, the default action scores need to be respected, and top-scoring actions need to be tie-broken by name.",
3033
"subjectKey": "bob",
31-
"subjectAttributes": {},
34+
"subjectAttributes": {
35+
"numericAttributes": {},
36+
"categoricalAttributes": {}
37+
},
3238
"actions": [
3339
{
3440
"actionKey": "toyota",

0 commit comments

Comments
 (0)