# Bandits and Stocks

DevFeed: [Bandits and Stocks](<https://devfeed.tech/articles/bandits-and-stocks-40335.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2013/12/09/bandits-and-stocks/>)

Published: 2013-12-09T09:00:52Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Machine Learning & Artificial Intelligence](<https://devfeed.tech/topics/machine-learning-artificial-intelligence.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [algorithms](<https://devfeed.tech/tags/algorithms.md>), [bandit-learning](<https://devfeed.tech/tags/bandit-learning.md>), [bandits](<https://devfeed.tech/tags/bandits.md>), [exp3](<https://devfeed.tech/tags/exp3.md>), [experimental](<https://devfeed.tech/tags/experimental.md>), [finance](<https://devfeed.tech/tags/finance.md>), [machine-learning](<https://devfeed.tech/tags/machine-learning.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [stocks](<https://devfeed.tech/tags/stocks.md>), [trading](<https://devfeed.tech/tags/trading.md>), [ucb1](<https://devfeed.tech/tags/ucb1.md>)

## AI overview

This article experiments with the UCB1 and Exp3 bandit-learning algorithms on stock-trading data to compare their performance under stochastic and adversarial assumptions. It emphasizes that the model is simplistic and does not solve stock trading.

## Source excerpt

So far in this series we've seen two nontrivial algorithms for bandit learning in two different settings. The first was the UCB1 algorithm, which operated under the assumption that the rewards for the trials were independent and stochastic. That is, each slot machine was essentially a biased coin flip, and the algorithm was trying to find the machine with the best odds. The second was the Exp3 algorithm, which held the belief that the payoffs were arbitrary.