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

Method sample

ab_testing/server_solution.py:27–31  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

25 self.name = name
26
27 def sample(self):
28 # Beta(1, 1) is the prior
29 a = 1 + self.clks
30 b = 1 + self.views - self.clks
31 return np.random.beta(a, b)
32
33 def add_click(self):
34 self.clks += 1

Callers 1

get_adFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected