@@ -95,7 +95,7 @@ def select_arm(self):
95
95
Example:
96
96
>>> strategy = EpsilonGreedy(epsilon=0.1, k=3)
97
97
>>> 0 <= strategy.select_arm() < 3
98
- True
98
+ np.True_
99
99
"""
100
100
rng = np .random .default_rng ()
101
101
@@ -116,7 +116,7 @@ def update(self, arm_index: int, reward: int):
116
116
>>> strategy = EpsilonGreedy(epsilon=0.1, k=3)
117
117
>>> strategy.update(0, 1)
118
118
>>> strategy.counts[0] == 1
119
- True
119
+ np.True_
120
120
"""
121
121
self .counts [arm_index ] += 1
122
122
n = self .counts [arm_index ]
@@ -175,7 +175,7 @@ def update(self, arm_index: int, reward: int):
175
175
>>> strategy = UCB(k=3)
176
176
>>> strategy.update(0, 1)
177
177
>>> strategy.counts[0] == 1
178
- True
178
+ np.True_
179
179
"""
180
180
self .counts [arm_index ] += 1
181
181
self .total_counts += 1
@@ -215,7 +215,7 @@ def select_arm(self):
215
215
Example:
216
216
>>> strategy = ThompsonSampling(k=3)
217
217
>>> 0 <= strategy.select_arm() < 3
218
- True
218
+ np.True_
219
219
"""
220
220
rng = np .random .default_rng ()
221
221
@@ -236,7 +236,7 @@ def update(self, arm_index: int, reward: int):
236
236
>>> strategy = ThompsonSampling(k=3)
237
237
>>> strategy.update(0, 1)
238
238
>>> strategy.successes[0] == 1
239
- True
239
+ np.True_
240
240
"""
241
241
if reward == 1 :
242
242
self .successes [arm_index ] += 1
@@ -270,7 +270,7 @@ def select_arm(self):
270
270
Example:
271
271
>>> strategy = RandomStrategy(k=3)
272
272
>>> 0 <= strategy.select_arm() < 3
273
- True
273
+ np.True_
274
274
"""
275
275
rng = np .random .default_rng ()
276
276
return rng .integers (self .k )
@@ -319,7 +319,7 @@ def select_arm(self):
319
319
Example:
320
320
>>> strategy = GreedyStrategy(k=3)
321
321
>>> 0 <= strategy.select_arm() < 3
322
- True
322
+ np.True_
323
323
"""
324
324
return np .argmax (self .values )
325
325
@@ -335,7 +335,7 @@ def update(self, arm_index: int, reward: int):
335
335
>>> strategy = GreedyStrategy(k=3)
336
336
>>> strategy.update(0, 1)
337
337
>>> strategy.counts[0] == 1
338
- True
338
+ np.True_
339
339
"""
340
340
self .counts [arm_index ] += 1
341
341
n = self .counts [arm_index ]
0 commit comments