This repository was archived by the owner on Nov 8, 2024. It is now read-only.
[ff-2352] Add optimality gap to bandit logging#50
Merged
Conversation
giorgiomartini0
approved these changes
Jun 6, 2024
| 0.0, | ||
| 0.0, | ||
| gamma, | ||
| flag_key, subject_key, subject_attributes, None, None, 0.0, 0.0, gamma, 0.0 |
There was a problem hiding this comment.
👍 the formatting change tripped me up at first; I thought some parameters had been re-ordered. No, this just adds 0.0 as the optimality gap (last parameter)
| return weights | ||
|
|
||
| def select_action(self, flag_key, subject_key, action_weights) -> Tuple[int, str]: | ||
| def select_action(self, flag_key, subject_key, action_weights) -> str: |
There was a problem hiding this comment.
Was this function incorrect before the change, or did you prefer having the selected_idx logic outside?
Author
There was a problem hiding this comment.
Yes the index corresponded to the sorted list, rather than the original list, so returning it was useless and caused the bug.
aarsilv
approved these changes
Jun 6, 2024
Contributor
aarsilv
left a comment
There was a problem hiding this comment.
Looks good! I assume we'll want an analogous change in the Java SDK as well
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
labels: mergeable
Fixes: #ff-2352
Motivation and Context
The optimality gap helps us understand how much the algorithm is trading of exploration and exploitation
Description
How has this been tested?