Skip to content

Commit 918168c

Browse files
authored
added LinearRegressionLearner, LogisticRegressionLearner with tests and fixed NeuralNetLearner and PerceptronLearner (#1163)
1 parent 70f4e82 commit 918168c

File tree

9 files changed

+506
-399
lines changed

9 files changed

+506
-399
lines changed

deep_learning4e.py

Lines changed: 170 additions & 93 deletions
Large diffs are not rendered by default.

learning.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ def parse_csv(input, delim=','):
201201
return [list(map(num_or_str, line.split(delim))) for line in lines]
202202

203203

204-
def err_ratio(predict, dataset, examples=None, verbose=0):
204+
def err_ratio(predict, dataset, examples=None):
205205
"""
206206
Return the proportion of the examples that are NOT correctly predicted.
207207
verbose - 0: No output; 1: Output wrong; 2 (or greater): Output correct
@@ -215,10 +215,6 @@ def err_ratio(predict, dataset, examples=None, verbose=0):
215215
output = predict(dataset.sanitize(example))
216216
if output == desired:
217217
right += 1
218-
if verbose >= 2:
219-
print(' OK: got {} for {}'.format(desired, example))
220-
elif verbose:
221-
print('WRONG: got {}, expected {} for {}'.format(output, desired, example))
222218
return 1 - (right / len(examples))
223219

224220

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy