Bandit logic refactoring #738
Replies: 3 comments 2 replies
-
Hello @MaxHalford I am great thank you ! Hope you're good as well :) The refactoring makes the whole structure more clean and offers better separation of concerns. Also, the formatting ( However, the class Also the current PR does not implement scaled reward : river/river/selection/bandit.py Line 48 in aae8d56 The consequence is that the end result of the selection process is highly dependent on initial conditions (like which arms were pulled the first times). Indeed, take the current example in Index MAE Pulls Share
0 32.114043 23 2.30%
1 28.959042 23 2.30%
2 1.576562 929 92.81%
3 623,644.303637 26 2.60% If you switch the order of the model 3 and 4 (e.g; learning rates list is now Index MAE Pulls Share
0 2.654030 921 92.01%
1 28.959042 23 2.30%
2 5,111,960,455.783644 42 4.20%
3 19.523921 15 1.50% |
Beta Was this translation helpful? Give feedback.
-
That's a good point! Reason why I did: for me a bandit is different that the solver that solves it. A bandit is the problem, a bandit is the algorithm which learns the best arm. But I hear you so I'll take another look and try to find a better design suggest.
Yes I omitted that part consciously! Thanks for taking the time to provide an example. I'll re-implement this week I think. I'd like to use the Cheers! |
Beta Was this translation helpful? Give feedback.
-
Right! And yet you may want to use
Will do!
Here you go (gonna move it to |
Beta Was this translation helpful? Give feedback.
-
Hey @etiennekintzler, how are you?
In #736 I did a significant tidy up of the
ensemble
module. I also renamed theexpert
module toselection
and moved of the methods there into theensemble
module. All in all I'm very happy with the changes.I took the liberty to refactor the bandit stuff you kindly implemented for us. In fact, I (temporarily) removed
UCBRegressor
and only included a diluted version ofEpsilonGreedyRegressor
.I refactored this code because I wanted to separate the bandit logic from the model selection logic. I hope you'll agree that the seperation of concerns is worthwhile.
Could I ask you to take a look at the
bandit.py
file if you have some time? Feel free to share any thoughts, or not. I'll move onto to integrating the other good stuff you implemented once I have your approval that the refactor is in the right direction.Kind regards!
Beta Was this translation helpful? Give feedback.
All reactions