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

Skip to content

Commit 651416e

Browse files
authored
Update learning.py
1 parent af98080 commit 651416e

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

learning.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""Learn to estimate functions from examples. (Chapters 18-20)"""
22

33
from utils import (
4-
removeall, unique, product, argmax, argmax_random_tie, isclose,
4+
removeall, unique, product, mode, argmax, argmax_random_tie, isclose,
55
dotproduct, vector_add, scalar_vector_product, weighted_sample_with_replacement,
66
weighted_sampler, num_or_str, normalize, clip, sigmoid, print_table, DataFile
77
)
@@ -16,11 +16,6 @@
1616

1717
# ______________________________________________________________________________
1818

19-
def mode(data):
20-
"""Return the most common data item. If there are ties, return any one of them."""
21-
(item, count) = Counter(data).most_common(1)
22-
return item
23-
2419
def rms_error(predictions, targets):
2520
return math.sqrt(ms_error(predictions, targets))
2621

0 commit comments

Comments
 (0)