private async Task ResetPolicy(PersonalizerAdministrationClient client) { PersonalizerPolicy policy = await client.ResetPersonalizerPolicyAsync(); Assert.AreEqual("--cb_explore_adf --epsilon 0.2 --power_t 0 -l 0.001 --cb_type mtr -q ::", policy.Arguments); }
public async Task ResetPolicy() { PersonalizerAdministrationClient client = GetPersonalizerAdministrationClient(); PersonalizerPolicy policy = await client.ResetPersonalizerPolicyAsync(); Assert.AreEqual("--cb_explore_adf --quadratic GT --quadratic MR --quadratic GR --quadratic ME --quadratic OT --quadratic OE --quadratic OR --quadratic MS --quadratic GX --ignore A --cb_type ips --epsilon 0.2", policy.Arguments); }
public async Task UpdatePolicy() { PersonalizerAdministrationClient client = GetPersonalizerAdministrationClient(); var policy = new PersonalizerPolicy( name: "app1", arguments: "--cb_explore_adf --quadratic GT --quadratic MR --quadratic GR --quadratic ME --quadratic OT --quadratic OE --quadratic OR --quadratic MS --quadratic GX --ignore A --cb_type ips --epsilon 0.2" ); PersonalizerPolicy updatedPolicy = await client.UpdatePersonalizerPolicyAsync(policy); Assert.NotNull(updatedPolicy); Assert.AreEqual(policy.Arguments, updatedPolicy.Arguments); }
private async Task UpdateAndGetPolicy(PersonalizerAdministrationClient client) { var newPolicy = new PersonalizerPolicy( name: "app1", arguments: "--cb_explore_adf --quadratic GT --quadratic MR --quadratic GR --quadratic ME --quadratic OT --quadratic OE --quadratic OR --quadratic MS --quadratic GX --ignore A --cb_type ips --epsilon 0.2" ); PersonalizerPolicy updatedPolicy = await client.UpdatePersonalizerPolicyAsync(newPolicy); Assert.NotNull(updatedPolicy); Assert.AreEqual(newPolicy.Arguments, updatedPolicy.Arguments); await Task.Delay(30000); PersonalizerPolicy policy = await client.GetPersonalizerPolicyAsync(); // Only checking the first 190 chars because the epsilon has a float rounding addition when applied Assert.AreEqual(newPolicy.Arguments, policy.Arguments.Substring(0, 190)); }