-
Notifications
You must be signed in to change notification settings - Fork 5
docs: Add how-to for integrating with vw-estimators #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| "\n", | ||
| "with open(\"example_cb.txt\") as dataset_file:\n", | ||
| " with vw.TextFormatReader(workspace, dataset_file) as reader:\n", | ||
| " for example in reader:\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"example" here vs "examples" in the next line (extract_label signature) is a bit confusing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. Perhaps I should rename to event?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I think it is better
| " logged_action_0_based, logged_cost, logged_prob = logged_label\n", | ||
| "\n", | ||
| " # 4. Get the probability of choosing the logged action according to the target policy\n", | ||
| " prediction_prob = next(x for i, x in pmf if i == logged_action_0_based)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nit] dict(pmf)[logged_action_0_based] (not sure which one is more readable)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh interesting, I didn't know you could init a dictionary like that
Requires #48