We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bf15924 commit 5316898Copy full SHA for 5316898
learning.py
@@ -376,7 +376,7 @@ def plurality_value(examples):
376
377
def count(attr, val, examples):
378
"""Count the number of examples that have attr = val."""
379
- return len(e[attr] == val for e in examples) #count(e[attr] == val for e in examples)
+ return sum(e[attr] == val for e in examples) #count(e[attr] == val for e in examples)
380
381
def all_same_class(examples):
382
"""Are all these examples in the same target class?"""
0 commit comments