Thompson

In the following example we load the boolean ad dataset containing 10.000 samples and 10 features (ads). We will investigate which ad was most succesful.

# Import library
import thompson as th

# Load example data
df = th.import_example()

# Compute which ad is best using multi-armed bandits
results = th.thompson(df)

# Plot
fig = th.plot(results)
Compute rewards per ad using Thompson

fig1

UCB-Upper confidence Bound

In the following example we load the boolean ad dataset containing 10.000 samples and 10 features (ads). We will investigate which ad was most succesful.

# Import library
import thompson as th

# Load example data
df = th.import_example()

# Compute which ad is best using multi-armed bandits
results = th.UCB(df)

# Plot
fig = th.plot(results)
Compute rewards per ad using UCB-Upper confidence Bound.

fig2

Randomized data

In the following example we load the boolean ad dataset containing 10.000 samples and 10 features (ads). We will investigate which ad was most succesful when randomizing the data.

# Import library
import thompson as th

# Load example data
df = th.import_example()

# Compute which ad is best using multi-armed bandits
results = th.UCB_random(df)

# Plot
fig = th.plot(results)
Compute rewards per ad using randomized data.

fig3