Skip to main content
Notice removed Authoritative reference needed by CommunityBot
Bounty Ended with no winning answer by CommunityBot
edited body; edited title
Source Link
M.R.
  • 31.8k
  • 8
  • 96
  • 289

Implementing Contextual Bandits in version 12

The multi-armed bandit problem (MAB) is a classic in Reinforcement learning. Now that mathematicaMathematica version 12 finally has support for Reinforcement learning:

In the style of this question, I'm asking is it possible to implement a multi-arm bandit using the new neural network framework in Version 12?

An Example Dataset to Play with

Here's a simple synthetic dataset of recommendations consisting of 500k rows each with three items: which algorithm the bandit chose for a given user (algo A or B), a vector of that user's (possibly missing) representative features, and lastly, whether or not the user interacted with whatever content the bandit's chosen algorithm presented:

d = CloudGet @ "https://www.wolframcloud.com/obj/21a37a6b-ab48-4014-88e3-1150b2b4429f";
d // Transpose

enter image description here

Notice that there are many more examples (this is typically the case) where no interaction occurred:

enter image description here

So that means training the bandit as a Classifier would require using ClassPriors and possibly weighting or augmenting the positive training data samples.

A bit of background on bandits:

MABs are what Netflix uses to choose the tiles that they show each of their users, check out their insightful blog post. Here's the basic idea:

The name comes from imagining a gambler at a row of slot machines (sometimes known as "one-armed bandits", each arm having its own rigged probability distribution), who has to decide which machines to play, how many times to play each machine and in which order to play them, and whether to continue with the current machine or try a different machine.

enter image description here

The contextual or multi-armed bandit problem is slightly different: in each iteration, an agent has to choose between arms. Before making the choice, the agent sees a d-dimensional feature vector (i.e. the context), and after the choice is made the environment gives a reward. Over many iterations, the agent learns a predictor function that takes a context and returns the next best arm to play. A simple and effective way to implement a MAB is with Thompson Sampling which uses Bayesian logic to maximize expected rewards.

Now that RL in MMA is possible, I'm hoping someone can provide examples of implementing and training contextual bandits in MMA. There are many pre-trained networks in the repository perhaps, perhaps some are applicable in reinforcement learning?

Notes:

Implementing Contextual Bandits in version 12

The multi-armed bandit problem (MAB) is a classic in Reinforcement learning. Now that mathematica version 12 finally has support for Reinforcement learning:

In the style of this question, I'm asking is it possible to implement a multi-arm bandit using the new neural network framework in Version 12?

An Example Dataset to Play with

Here's a simple synthetic dataset of recommendations consisting of 500k rows each with three items: which algorithm the bandit chose for a given user (algo A or B), a vector of that user's (possibly missing) representative features, and lastly, whether or not the user interacted with whatever content the bandit's chosen algorithm presented:

d = CloudGet @ "https://www.wolframcloud.com/obj/21a37a6b-ab48-4014-88e3-1150b2b4429f";
d // Transpose

enter image description here

Notice that there are many more examples (this is typically the case) where no interaction occurred:

enter image description here

So that means training the bandit as a Classifier would require using ClassPriors and possibly weighting or augmenting the positive training data samples.

A bit of background on bandits:

MABs are what Netflix uses to choose the tiles that they show each of their users, check out their insightful blog post. Here's the basic idea:

The name comes from imagining a gambler at a row of slot machines (sometimes known as "one-armed bandits", each arm having its own rigged probability distribution), who has to decide which machines to play, how many times to play each machine and in which order to play them, and whether to continue with the current machine or try a different machine.

enter image description here

The contextual or multi-armed bandit problem is slightly different: in each iteration, an agent has to choose between arms. Before making the choice, the agent sees a d-dimensional feature vector (i.e. the context), and after the choice is made the environment gives a reward. Over many iterations, the agent learns a predictor function that takes a context and returns the next best arm to play. A simple and effective way to implement a MAB is with Thompson Sampling which uses Bayesian logic to maximize expected rewards.

Now that RL in MMA is possible, I'm hoping someone can provide examples of implementing and training contextual bandits in MMA. There are many pre-trained networks in the repository perhaps, perhaps some are applicable in reinforcement learning?

Notes:

Implementing Contextual Bandits

The multi-armed bandit problem (MAB) is a classic in Reinforcement learning. Now that Mathematica version 12 finally has support for Reinforcement learning:

In the style of this question, I'm asking is it possible to implement a multi-arm bandit using the new neural network framework in Version 12?

An Example Dataset to Play with

Here's a simple synthetic dataset of recommendations consisting of 500k rows each with three items: which algorithm the bandit chose for a given user (algo A or B), a vector of that user's (possibly missing) representative features, and lastly, whether or not the user interacted with whatever content the bandit's chosen algorithm presented:

d = CloudGet @ "https://www.wolframcloud.com/obj/21a37a6b-ab48-4014-88e3-1150b2b4429f";
d // Transpose

enter image description here

Notice that there are many more examples (this is typically the case) where no interaction occurred:

enter image description here

So that means training the bandit as a Classifier would require using ClassPriors and possibly weighting or augmenting the positive training data samples.

A bit of background on bandits:

MABs are what Netflix uses to choose the tiles that they show each of their users, check out their insightful blog post. Here's the basic idea:

The name comes from imagining a gambler at a row of slot machines (sometimes known as "one-armed bandits", each arm having its own rigged probability distribution), who has to decide which machines to play, how many times to play each machine and in which order to play them, and whether to continue with the current machine or try a different machine.

enter image description here

The contextual or multi-armed bandit problem is slightly different: in each iteration, an agent has to choose between arms. Before making the choice, the agent sees a d-dimensional feature vector (i.e. the context), and after the choice is made the environment gives a reward. Over many iterations, the agent learns a predictor function that takes a context and returns the next best arm to play. A simple and effective way to implement a MAB is with Thompson Sampling which uses Bayesian logic to maximize expected rewards.

Now that RL in MMA is possible, I'm hoping someone can provide examples of implementing and training contextual bandits in MMA. There are many pre-trained networks in the repository perhaps, perhaps some are applicable in reinforcement learning?

Notes:

deleted 11 characters in body
Source Link
M.R.
  • 31.8k
  • 8
  • 96
  • 289

The multi-armed bandit problem (MAB) is a classic in Reinforcement learning. Now that mathematica version 12 finally has support for Reinforcement learning:

In the style of this question, I'm asking is it possible to implement a multi-arm bandit using the new neural network framework in Version 12?

An Example Dataset to Play with

Here's a simple synthetic dataset of recommendations consisting of 500k rows each with three items: which algorithm the bandit chose for a given user (algo A or B), a vector of that user's (possibly missing) representative features, and lastly, whether or not the user interacted with whatever content the bandit's chosen algorithm presented:

d = CloudGet @ "https://www.wolframcloud.com/obj/21a37a6b-ab48-4014-88e3-1150b2b4429f";
d // Transpose

enter image description here

Notice that there are many more examples (this is typically the case) where no interaction occurred:

enter image description here

So that means training the bandit as a Classifier would require using ClassPriors and possibly weighting or augmenting the positive training data samples.

ReferencesA bit of background on bandits:

A bit of background on bandits: MABs are what Netflix uses to choose the tiles that they show each of their users, check out their insightful blog post. Here's the basic idea:

The name comes from imagining a gambler at a row of slot machines (sometimes known as "one-armed bandits", each arm having its own rigged probability distribution), who has to decide which machines to play, how many times to play each machine and in which order to play them, and whether to continue with the current machine or try a different machine.

enter image description here

The contextual or multi-armed bandit problem is slightly different: in each iteration, an agent has to choose between arms. Before making the choice, the agent sees a d-dimensional feature vector (i.e. the context), and after the choice is made the environment gives a reward. Over many iterations, the agent learns a predictor function that takes a context and returns the next best arm to play. A simple and effective way to implement a MAB is with Thompson Sampling which uses Bayesian logic to maximize expected rewards.

Now that RL in MMA is possible, I'm hoping someone can provide examples of implementing and training contextual bandits in MMA. There are many pre-trained networks in the repository perhaps, perhaps some are applicable in reinforcement learning?

Notes:

The multi-armed bandit problem (MAB) is a classic in Reinforcement learning. Now that mathematica version 12 finally has support for Reinforcement learning:

In the style of this question, I'm asking is it possible to implement a multi-arm bandit using the new neural network framework in Version 12?

An Example Dataset to Play with

Here's a simple synthetic dataset of recommendations consisting of 500k rows each with three items: which algorithm the bandit chose for a given user (algo A or B), a vector of that user's (possibly missing) representative features, and lastly, whether or not the user interacted with whatever content the bandit's chosen algorithm presented:

d = CloudGet @ "https://www.wolframcloud.com/obj/21a37a6b-ab48-4014-88e3-1150b2b4429f";
d // Transpose

enter image description here

Notice that there are many more examples (this is typically the case) where no interaction occurred:

enter image description here

So that means training the bandit as a Classifier would require using ClassPriors and possibly weighting or augmenting the positive training data samples.

References

A bit of background on bandits: MABs are what Netflix uses to choose the tiles that they show each of their users, check out their insightful blog post. Here's the basic idea:

The name comes from imagining a gambler at a row of slot machines (sometimes known as "one-armed bandits", each arm having its own rigged probability distribution), who has to decide which machines to play, how many times to play each machine and in which order to play them, and whether to continue with the current machine or try a different machine.

enter image description here

The contextual or multi-armed bandit problem is slightly different: in each iteration, an agent has to choose between arms. Before making the choice, the agent sees a d-dimensional feature vector (i.e. the context), and after the choice is made the environment gives a reward. Over many iterations, the agent learns a predictor function that takes a context and returns the next best arm to play. A simple and effective way to implement a MAB is with Thompson Sampling which uses Bayesian logic to maximize expected rewards.

Now that RL in MMA is possible, I'm hoping someone can provide examples of implementing and training contextual bandits in MMA. There are many pre-trained networks in the repository perhaps, perhaps some are applicable in reinforcement learning?

Notes:

The multi-armed bandit problem (MAB) is a classic in Reinforcement learning. Now that mathematica version 12 finally has support for Reinforcement learning:

In the style of this question, I'm asking is it possible to implement a multi-arm bandit using the new neural network framework in Version 12?

An Example Dataset to Play with

Here's a simple synthetic dataset of recommendations consisting of 500k rows each with three items: which algorithm the bandit chose for a given user (algo A or B), a vector of that user's (possibly missing) representative features, and lastly, whether or not the user interacted with whatever content the bandit's chosen algorithm presented:

d = CloudGet @ "https://www.wolframcloud.com/obj/21a37a6b-ab48-4014-88e3-1150b2b4429f";
d // Transpose

enter image description here

Notice that there are many more examples (this is typically the case) where no interaction occurred:

enter image description here

So that means training the bandit as a Classifier would require using ClassPriors and possibly weighting or augmenting the positive training data samples.

A bit of background on bandits:

MABs are what Netflix uses to choose the tiles that they show each of their users, check out their insightful blog post. Here's the basic idea:

The name comes from imagining a gambler at a row of slot machines (sometimes known as "one-armed bandits", each arm having its own rigged probability distribution), who has to decide which machines to play, how many times to play each machine and in which order to play them, and whether to continue with the current machine or try a different machine.

enter image description here

The contextual or multi-armed bandit problem is slightly different: in each iteration, an agent has to choose between arms. Before making the choice, the agent sees a d-dimensional feature vector (i.e. the context), and after the choice is made the environment gives a reward. Over many iterations, the agent learns a predictor function that takes a context and returns the next best arm to play. A simple and effective way to implement a MAB is with Thompson Sampling which uses Bayesian logic to maximize expected rewards.

Now that RL in MMA is possible, I'm hoping someone can provide examples of implementing and training contextual bandits in MMA. There are many pre-trained networks in the repository perhaps, perhaps some are applicable in reinforcement learning?

Notes:

Notice added Authoritative reference needed by M.R.
Bounty Started worth 200 reputation by M.R.
added 954 characters in body
Source Link
M.R.
  • 31.8k
  • 8
  • 96
  • 289

The multi-armed bandit problem (MAB) is a classic in Reinforcement learning. Now that mathematica version 12 finally has support for Reinforcement learning:

In the style of this question, I'm asking is it possible to implement a multi-arm bandit using the new neural network framework in Version 12?

A bit of background on banditsAn Example Dataset to Play with

Here's a simple synthetic dataset of recommendations consisting of 500k rows each with three items: which algorithm the bandit chose for a given user (algo A or B), a vector of that user's (possibly missing) representative features, and lastly, whether or not the user interacted with whatever content the bandit's chosen algorithm presented:

d = CloudGet @ "https://www.wolframcloud.com/obj/21a37a6b-ab48-4014-88e3-1150b2b4429f";
d // Transpose

enter image description here

Notice that there are many more examples (this is typically the case) where no interaction occurred:

enter image description here

So that means training the bandit as a Classifier would require using ClassPriors and possibly weighting or augmenting the positive training data samples.

References

A bit of background on bandits: MABs are what Netflix uses to choose the tiles that they show each of their users, check out their insightful blog post. Here's the basic idea:

The name comes from imagining a gambler at a row of slot machines (sometimes known as "one-armed bandits", each arm having its own rigged probability distribution), who has to decide which machines to play, how many times to play each machine and in which order to play them, and whether to continue with the current machine or try a different machine.

enter image description here

The contextual or multi-armed bandit problem is slightly different: in each iteration, an agent has to choose between arms. Before making the choice, the agent sees a d-dimensional feature vector (i.e. the context), and after the choice is made the environment gives a reward. Over many iterations, the agent learns a predictor function that takes a context and returns the next best arm to play. A simple and effective way to implement a MAB is with Thompson Sampling which uses Bayesian logic to maximize expected rewards.

Now that RL in MMA is possible, I'm hoping someone can provide examples of implementing and training contextual bandits in MMA. There are many pre-trained networks in the repository perhaps, perhaps some are applicable in reinforcement learning?

Notes:

The multi-armed bandit problem (MAB) is a classic in Reinforcement learning. Now that mathematica version 12 finally has support for Reinforcement learning:

In the style of this question, I'm asking is it possible to implement a multi-arm bandit using the new neural network framework in Version 12?

A bit of background on bandits

MABs are what Netflix uses to choose the tiles that they show each of their users, check out their insightful blog post. Here's the basic idea:

The name comes from imagining a gambler at a row of slot machines (sometimes known as "one-armed bandits", each arm having its own rigged probability distribution), who has to decide which machines to play, how many times to play each machine and in which order to play them, and whether to continue with the current machine or try a different machine.

enter image description here

The contextual or multi-armed bandit problem is slightly different: in each iteration, an agent has to choose between arms. Before making the choice, the agent sees a d-dimensional feature vector (i.e. the context), and after the choice is made the environment gives a reward. Over many iterations, the agent learns a predictor function that takes a context and returns the next best arm to play. A simple and effective way to implement a MAB is with Thompson Sampling which uses Bayesian logic to maximize expected rewards.

Now that RL in MMA is possible, I'm hoping someone can provide examples of implementing and training contextual bandits in MMA. There are many pre-trained networks in the repository perhaps, perhaps some are applicable in reinforcement learning?

Notes:

The multi-armed bandit problem (MAB) is a classic in Reinforcement learning. Now that mathematica version 12 finally has support for Reinforcement learning:

In the style of this question, I'm asking is it possible to implement a multi-arm bandit using the new neural network framework in Version 12?

An Example Dataset to Play with

Here's a simple synthetic dataset of recommendations consisting of 500k rows each with three items: which algorithm the bandit chose for a given user (algo A or B), a vector of that user's (possibly missing) representative features, and lastly, whether or not the user interacted with whatever content the bandit's chosen algorithm presented:

d = CloudGet @ "https://www.wolframcloud.com/obj/21a37a6b-ab48-4014-88e3-1150b2b4429f";
d // Transpose

enter image description here

Notice that there are many more examples (this is typically the case) where no interaction occurred:

enter image description here

So that means training the bandit as a Classifier would require using ClassPriors and possibly weighting or augmenting the positive training data samples.

References

A bit of background on bandits: MABs are what Netflix uses to choose the tiles that they show each of their users, check out their insightful blog post. Here's the basic idea:

The name comes from imagining a gambler at a row of slot machines (sometimes known as "one-armed bandits", each arm having its own rigged probability distribution), who has to decide which machines to play, how many times to play each machine and in which order to play them, and whether to continue with the current machine or try a different machine.

enter image description here

The contextual or multi-armed bandit problem is slightly different: in each iteration, an agent has to choose between arms. Before making the choice, the agent sees a d-dimensional feature vector (i.e. the context), and after the choice is made the environment gives a reward. Over many iterations, the agent learns a predictor function that takes a context and returns the next best arm to play. A simple and effective way to implement a MAB is with Thompson Sampling which uses Bayesian logic to maximize expected rewards.

Now that RL in MMA is possible, I'm hoping someone can provide examples of implementing and training contextual bandits in MMA. There are many pre-trained networks in the repository perhaps, perhaps some are applicable in reinforcement learning?

Notes:

Notice removed Authoritative reference needed by CommunityBot
Bounty Ended with no winning answer by CommunityBot
Notice added Authoritative reference needed by M.R.
Bounty Started worth 100 reputation by M.R.
added 365 characters in body
Source Link
M.R.
  • 31.8k
  • 8
  • 96
  • 289
Loading
Tweeted twitter.com/StackMma/status/1126638177169608704
Source Link
M.R.
  • 31.8k
  • 8
  • 96
  • 289
Loading