We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddbce91 commit 46fdb1bCopy full SHA for 46fdb1b
machine_learning/mab.py
@@ -159,8 +159,7 @@ def select_arm(self):
159
"""
160
if self.total_counts < self.k:
161
return self.total_counts
162
- ucb_values = self.values + \
163
- np.sqrt(2 * np.log(self.total_counts) / self.counts)
+ ucb_values = self.values + np.sqrt(2 * np.log(self.total_counts) / self.counts)
164
return np.argmax(ucb_values)
165
166
def update(self, arm_index: int, reward: int):
@@ -388,5 +387,6 @@ def test_mab_strategies():
388
387
389
if __name__ == "__main__":
390
import doctest
+
391
doctest.testmod()
392
test_mab_strategies()
0 commit comments