File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,9 @@ def ms_error(predictions, targets):
31
31
def mean_error (predictions , targets ):
32
32
return mean ([abs (p - t ) for p , t in zip (predictions , targets )])
33
33
34
+ def manhattan_distance (predictions , targets ):
35
+ return sum ([abs (p - t ) for p , t in zip (predictions , targets )])
36
+
34
37
35
38
def mean_boolean_error (predictions , targets ):
36
39
return mean ([(p != t ) for p , t in zip (predictions , targets )])
@@ -122,7 +125,7 @@ def check_me(self):
122
125
assert self .target not in self .inputs
123
126
assert set (self .inputs ).issubset (set (self .attrs ))
124
127
if self .got_values_flag :
125
- # no need to check if values aren't provided while initializing DataSet
128
+ # only check if values are provided while initializing DataSet
126
129
list (map (self .check_example , self .examples ))
127
130
128
131
def add_example (self , example ):
You can’t perform that action at this time.
0 commit comments