News for hackers. Stuff that matters.
Re:Multi-Armed Bandits, Conjugate Models and Bayesian Reinfo... by heydenberk on Friday August 31, 2018 @09:41AM (#17885479)
I spent two years[0] designing, building and maintaining a system which used contextual multi-armed bandits at large scale. A couple pieces of advice relating to this post and this subject:

1. Thompson sampling is great. It's intuitive and computationally tractable. The literature is full of other strategies, specifically semi-uniform strategies, but I strongly recommend using Thompson sampling if it works for your problem.

2. This is broadly true about ML, but for contextual bandits, most of the engineering work will probably be the feature engineering, not algorithm implementation. Plan accordingly. Choosing the right inputs in the first place makes a big difference. The hashing trick (a la sklearn's dictvectorizer) can make a huge difference.

3. It can be difficult to obtain organizational alignment on the intention of using reinforcement learning. Tell stakeholders early and often that you're using bandit algos to produce some kind of outcome — say, clicks or conversions — and not to do science which will uncover deep truths.

[0] along with an excellent data scientist and a team of excellent engineers, of course :)

Re:Multi-Armed Bandits, Conjugate Models and Bayesian Reinfo... by antidesitter on Friday August 31, 2018 @08:10PM (#17889349)
> Thompson sampling is great. It's intuitive and computationally tractable. The literature is full of other strategies, specifically semi-uniform strategies, but I strongly recommend using Thompson sampling if it works for your problem.

Spot on. For more information about the advantages of Thompson sampling over other approaches, see Why is Posterior Sampling Better than Optimism for Reinforcement Learning? [1] by Osband and Van Roy.

[1] http://proceedings.mlr.press/v70/osband17a/osband17a.pdf

Re:Multi-Armed Bandits, Conjugate Models and Bayesian Reinfo... by ma2rten on Friday August 31, 2018 @11:31PM (#17890035)
The hashing trick (a la sklearn's dictvectorizer) can make a huge difference.

I'm not a huge fan of that. Hash collisions can lead to unexpected behaviors in production and make feature attribution for debugging harder.

It's slightly more effort to implement, but with a trie data structure you can store even the biggest feature mapping in memory.

Re:Multi-Armed Bandits, Conjugate Models and Bayesian Reinfo... by achompas on Saturday September 01, 2018 @11:02AM (#17892141)
Does the fact that sklearn reverses signs for features that collide change your opinion?
Re:Multi-Armed Bandits, Conjugate Models and Bayesian Reinfo... by lsorber on Saturday September 01, 2018 @01:48AM (#17890459)
How are you compressing the feature space in that case, by truncating the trie?
Re:Multi-Armed Bandits, Conjugate Models and Bayesian Reinfo... by ma2rten on Saturday September 01, 2018 @02:16AM (#17890535)
You could use clustering, dimensionality reduce or feature selection.

However, the way I have seen the hashing trick being used is not to compress the feature space. For most problems it would be a bad idea to just lump your most discriminative features together with some other random ones. Instead people just choose a very large feature space which makes collisions unlikely. For model implementations using sparse matrices it doesn't matter if the feature space is very large. The main advantage of this is that you don't have to keep an expensive hash map of your vocabulary in memory (hence my suggestion to use a trie).

Re:Multi-Armed Bandits, Conjugate Models and Bayesian Reinfo... by _eigenfoo on Friday August 31, 2018 @10:48AM (#17885997)
Incredible! Thanks for sharing the advice :)
Re:Multi-Armed Bandits, Conjugate Models and Bayesian Reinfo... by heydenberk on Friday August 31, 2018 @10:58AM (#17886089)
Thank you for the post!
Re:Multi-Armed Bandits, Conjugate Models and Bayesian Reinfo... by gwulf on Friday August 31, 2018 @05:50PM (#17888808)
+1 for thompson sampling