Skip to content
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

Added interface and module for ccb #37

Merged
merged 1 commit into from
Jul 20, 2021
Merged

Conversation

JuiP
Copy link
Contributor

@JuiP JuiP commented Jul 16, 2021

#27

@ataymano @cheng-tan

  • Add interface for ccb estimator (base.py) - similar to slates, but the reward is a list of the same length as probabilities

@JuiP JuiP mentioned this pull request Jul 16, 2021
2 tasks
""" Interface for implementation of conditional contextual bandits estimators """

@abstractmethod
def add_example(self, p_log: List, r: List, p_pred: List, count: float) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to rename count since it's a float?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should do it, but probably not in this PR: all other estimators still have it as count, so it is probably better to be consistent at this point.

Args:
alpha: alpha value
Returns:
Returns the confidence interval as list[float]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it will return [min_bound, max_bound] only for the first slot? description is a bit general here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is fine to be generic here since this is an interface.

@JuiP
Copy link
Contributor Author

JuiP commented Jul 18, 2021

So is this PR good to go?

@ataymano
Copy link
Member

So is this PR good to go?

Looks good to me. @cheng-tan , please let me know. what you think.

@ataymano ataymano merged commit a537024 into VowpalWabbit:rlos2021_cfe Jul 20, 2021
ataymano added a commit that referenced this pull request Feb 14, 2022
* Initial file structure changes for Package (#16)

* Interface Approach2 (#29)

* Split ips and snips. Make two classes: Estimator and Interval

* Split pseudo_inverse into 2 classes: Estimator and Interval

* Fix test_pi, remove redundant file ips_snips, Remove type argument from get_estimate

* Slates interface implementation

* Cb interface initial commit

* Rename file and change class names

* Edit doc strings

* Change count datatype to float in cb_base

* Added gaussian, clopper_pearson files and removed type from cb interface

* Add newline at the end of file

* Changes for slates

- Renamed file from slates_helper to slates_base
- Added gaussian.py
- Removed type from get_interval
- Removed type from get_estimate
- Change doc strings for the slates interface
- Changed class names
- Changed data type of count
- Fixed data type of p_log and p_pred
- Removed unused imports

* Remove redundant imports and code

* Change method name to get()

* Rename file to base and change class name of ips, snips

* Change doc strings and variable name: slates

* Changes for test_pi

* Cressieread Interval update

* Changes folder name and class names (#31)

* Minimal changes tobasic-usage (#32)

* Improvements for setup.py and slates (#33)

* imports fix (#34)

* Adding Tests (#35)

* Unit tests added

* Test for multiple examples

* Added test for checking narrowing intervals

* Combine all unit test functions into one

* Added comments

* Added another example generator

* Fixed Imports

* Change variable names and fix typo

* Added check for correct format of Confidence Interval

* Separate bandit and slates tests

* Move functions to utils

* Added test for correctness(slates)

* Comments added for test_bandits

* Added tests for slates intervals

* Move data generators from helper files to test_* files

* Remove num_slots as a parameter in util functions

* Combine run_estimator function

* Combine SlatesHelper and BanditsHelper

* Move assert statements from run_estimator() to test_*.py

* Move assert statements from Helper() functions to test_*.py file

* Improving code consistency

* Defined static methods and renamed file to utils.py

* Add function assert_is_close to utils

* Variable name changed

* Restructuring of code

* CI improvements (#38)

* Added support for Python version 3.9

* CI: Check test coverage

* Added interface and module for ccb (#37)

* Added ccb estimator (#39)

* Added ccb estimator file

* Removed type and added Interval()

* Added unit test for ccb + code corrections in ccb.py

* Test for correctness and narrowing Intervals added

* Changed module name

* Change variable name

* Removed hard coding for specific alpha values in gaussain files (#44)

* Add tests (#43)

* use random.seed() to make test scenarios reproducible

* Change function names

* Rename variables

* Rename variables listofestimators->estimators and listofintervals->intervals

* Renamed variables for test_narrowing_intervals

* Added test to check alpha value is not hardcoded for bandits

* Renamed to test_different_alpha_CI

* Rlos2021 minor cleanup (#45)

* minor cleanups

* py35 removal

* more type hints

* snake case

* ValueError

* snake case

Co-authored-by: Alexey Taymanov <[email protected]>
Co-authored-by: Alexey Taymanov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants