Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5f715bf

Browse files
committed
Fixed: bools aren't ints in modern Python. (Didn't really matter.)
1 parent 8d28f9c commit 5f715bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

learning.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ def Majority(k, n):
553553
examples = []
554554
for i in range(n):
555555
bits = [random.choice([0, 1]) for i in range(k)]
556-
bits.append(sum(bits) > k/2)
556+
bits.append(int(sum(bits) > k/2))
557557
examples.append(bits)
558558
return DataSet(name="majority", examples=examples)
559559

0 commit comments

Comments
 (0)