MCPcopy Create free account
hub / github.com/lazyprogrammer/machine_learning_examples / plot

Function plot

ab_testing/bayesian_bandit.py:39–46  ·  view source on GitHub ↗
(bandits, trial)

Source from the content-addressed store, hash-verified

37
38
39def plot(bandits, trial):
40 x = np.linspace(0, 1, 200)
41 for b in bandits:
42 y = beta.pdf(x, b.a, b.b)
43 plt.plot(x, y, label=f"real p: {b.p:.4f}, win rate = {b.a - 1}/{b.N}")
44 plt.title(f"Bandit distributions after {trial} trials")
45 plt.legend()
46 plt.show()
47
48
49def experiment():

Callers 1

experimentFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected