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

If r != 0 then could be working for negative reward as well? #69

Open
charalak opened this issue Jan 9, 2024 · 1 comment
Open

If r != 0 then could be working for negative reward as well? #69

charalak opened this issue Jan 9, 2024 · 1 comment

Comments

@charalak
Copy link

charalak commented Jan 9, 2024

In the following line
https://github.com/david-cortes/contextualbandits/blob/7b87efe31ffefdbc95a125d557920ab5b13105c5/contextualbandits/utils.py#L912C13-L912C34

if we replace arms_w_rew = (r > 0.) with arms_w_rew = (r != 0.) then "BootstrappedUCB" and "BootstrappedTS" could work and incorporate negative rewards (I guess).

@david-cortes
Copy link
Owner

Thanks for the suggestion.

There's unfortunately many other places scattered throughout the code where the assumption about binary rewards is used, such as this one:

self.bs_algos[sample].partial_fit(xsample, ysample, classes=[0,1])

Plus other methodological aspects which specifically exploit the assumption of rewards being binary, like the usage of a beta distribution whose priors are updated iteratively, or the calculation of uncertainty in active learning criteria.

Hence, you might find that changing that line might be sufficient for allowing negative rewards for some particular combinations of input parameters, but it will not guarantee that everything else will work along with them.

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

No branches or pull requests

2 participants