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

Function click_ad

ab_testing/server_solution.py:62–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60
61@app.route('/click_ad', methods=['POST'])
62def click_ad():
63 result = 'OK'
64 if request.form['advertisement_id'] == 'A':
65 banditA.add_click()
66 elif request.form['advertisement_id'] == 'B':
67 banditB.add_click()
68 else:
69 result = 'Invalid Input.'
70
71 # nothing to return really
72 return jsonify({'result': result})
73
74
75if __name__ == '__main__':

Callers

nothing calls this directly

Calls 1

add_clickMethod · 0.80

Tested by

no test coverage detected