diff --git a/ufc/bandit-flags-v1.json b/ufc/bandit-flags-v1.json index 9e066fd..72c5cc4 100644 --- a/ufc/bandit-flags-v1.json +++ b/ufc/bandit-flags-v1.json @@ -227,6 +227,31 @@ } ], "totalShards": 10000 + }, + "cold_start_bandit_flag": { + "key": "cold_start_bandit_flag", + "enabled": true, + "variationType": "STRING", + "variations": { + "cold_start_bandit": { + "key": "cold_start_bandit", + "value": "cold_start_bandit" + } + }, + "allocations": [ + { + "key": "all-traffic", + "rules": [], + "splits": [ + { + "variationKey": "cold_start_bandit", + "shards": [] + } + ], + "doLog": true + } + ], + "totalShards": 10000 } }, "bandits": { @@ -286,7 +311,7 @@ "variationValue": "banner_bandit" } ], - "modelVersion": "v123" + "modelVersion": "123" }, "car_bandit": { "flagVariations": [ @@ -298,7 +323,7 @@ "variationValue": "car_bandit" } ], - "modelVersion": "v456" + "modelVersion": "456" }, "cold_start_bandit": { "flagVariations": [ diff --git a/ufc/bandit-models-v1.json b/ufc/bandit-models-v1.json index de4e392..eedff39 100644 --- a/ufc/bandit-models-v1.json +++ b/ufc/bandit-models-v1.json @@ -8,7 +8,7 @@ "banditKey": "banner_bandit", "modelName": "falcon", "updatedAt": "2023-09-13T04:52:06.462Z", - "modelVersion": "v123", + "modelVersion": "123", "modelData": { "gamma": 1.0, "defaultActionScore": 0.0, @@ -28,9 +28,9 @@ { "attributeKey": "loyalty_tier", "valueCoefficients": { - "gold": 4.5, - "silver": 3.2, - "bronze": 1.9 + "gold": 4.5, + "silver": 3.2, + "bronze": 1.9 }, "missingValueCoefficient": 0.0 }, @@ -110,7 +110,7 @@ "banditKey": "car_bandit", "modelName": "falcon", "updatedAt": "2023-09-13T04:52:06.462Z", - "modelVersion": "v456", + "modelVersion": "456", "modelData": { "gamma": 1.0, "defaultActionScore": 5.0, @@ -143,5 +143,5 @@ "coefficients": {} } } - } + } } diff --git a/ufc/bandit-tests/test-case-bandit-cold-start.json b/ufc/bandit-tests/test-case-bandit-cold-start.json new file mode 100644 index 0000000..be04ddf --- /dev/null +++ b/ufc/bandit-tests/test-case-bandit-cold-start.json @@ -0,0 +1,81 @@ +{ + "flag": "cold_start_bandit_flag", + "defaultValue": "default", + "subjects": [ + { + "subjectKey": "alice", + "subjectAttributes": { + "numericAttributes": {}, + "categoricalAttributes": {} + }, + "actions": [ + { + "actionKey": "red", + "numericAttributes": {}, + "categoricalAttributes": {} + }, + { + "actionKey": "blue", + "numericAttributes": {}, + "categoricalAttributes": {} + }, + { + "actionKey": "green", + "numericAttributes": {}, + "categoricalAttributes": {} + } + ], + "assignment": {"variation": "cold_start_bandit", "action": "red"} + }, + { + "subjectKey": "bob", + "subjectAttributes": { + "numericAttributes": {}, + "categoricalAttributes": {} + }, + "actions": [ + { + "actionKey": "red", + "numericAttributes": {}, + "categoricalAttributes": {} + }, + { + "actionKey": "blue", + "numericAttributes": {}, + "categoricalAttributes": {} + }, + { + "actionKey": "green", + "numericAttributes": {}, + "categoricalAttributes": {} + } + ], + "assignment": {"variation": "cold_start_bandit", "action": "green"} + }, + { + "subjectKey": "charles", + "subjectAttributes": { + "numericAttributes": {}, + "categoricalAttributes": {} + }, + "actions": [ + { + "actionKey": "red", + "numericAttributes": {}, + "categoricalAttributes": {} + }, + { + "actionKey": "blue", + "numericAttributes": {}, + "categoricalAttributes": {} + }, + { + "actionKey": "green", + "numericAttributes": {}, + "categoricalAttributes": {} + } + ], + "assignment": {"variation": "cold_start_bandit", "action": "blue"} + } + ] +}