Alanthink / banditpylib

A lightweight python library for bandit algorithms
https://alanthink.github.io/banditpylib-doc/
MIT License
29 stars 5 forks source link

Correlated bai #4

Closed choltz95 closed 4 years ago

choltz95 commented 4 years ago

To get more familiar with the api for best arm identification in fixed conf setting I implement the alg & environment from https://arxiv.org/abs/1710.05552 for [single player] best arm selection in linear/correlated bandit environment. Still need to debug some of the functions, but it looks like it's working okay at the moment. A little slower compared to lilUCB. Could use your comments.

Screen Shot 2020-02-23 at 4 10 44 PM Screen Shot 2020-02-23 at 4 10 32 PM
pep8speaks commented 4 years ago

Hello @choltz95! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 38:12: E126 continuation line over-indented for hanging indent Line 38:64: W504 line break after binary operator Line 39:55: W504 line break after binary operator Line 53:38: W504 line break after binary operator Line 89:33: E127 continuation line over-indented for visual indent

Comment last updated at 2020-02-24 20:12:08 UTC
choltz95 commented 4 years ago

For the correlated algorithms I think I can move the em arm initialization to utils _model_init:

    # initalize em arms repr
    for k in range(self._arm_num):
      self._em_arms[k].action = self._bandit.actions[k]
Alanthink commented 4 years ago

For the correlated algorithms I think I can move the em arm initialization to utils _model_init:

    # initalize em arms repr
    for k in range(self._arm_num):
      self._em_arms[k].action = self._bandit.actions[k]

Yes, I think this is a good idea. Can you fix the warnings generated by pep8? Also, can you add the ref in the readme file?

choltz95 commented 4 years ago

Note: only implemented greedy selection strategy