aboutsummaryrefslogtreecommitdiff
path: root/src/logreg_train.py
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-08-29 17:49:39 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-08-29 17:52:47 +0200
commit5a2fb0139e5797a48afa1ca646a26c09c7a56936 (patch)
tree516a288bb53064bf212d7a4e03663b479ed43442 /src/logreg_train.py
parenta1c7fe1b6d95e2560e62c12453da287d36d4a714 (diff)
downloaddslr-5a2fb0139e5797a48afa1ca646a26c09c7a56936.tar.gz
dslr-5a2fb0139e5797a48afa1ca646a26c09c7a56936.tar.bz2
dslr-5a2fb0139e5797a48afa1ca646a26c09c7a56936.zip
Added logreg_predictHEADmaster
Diffstat (limited to 'src/logreg_train.py')
-rwxr-xr-xsrc/logreg_train.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/logreg_train.py b/src/logreg_train.py
index e02e101..6254494 100755
--- a/src/logreg_train.py
+++ b/src/logreg_train.py
@@ -35,7 +35,7 @@ def train(ys, xs):
ys_ally = ys.copy()
ys_ally[ys == trained] = 0 # opposite?
ys_ally[ys != trained] = 1
- thetas.append((trained, gradient_descent(ys_ally, xs, 1, 2)))
+ thetas.append((trained, gradient_descent(ys_ally, xs, 1, 100)))
return thetas
if __name__ == '__main__':
@@ -51,5 +51,5 @@ if __name__ == '__main__':
thetas = train(Y, X)
with open("weights", "w") as f:
- for name, t in thetas:
- f.write("{}: {}\n".format(name, ','.join([str(x) for x in t])))
+ for label, t in thetas:
+ f.write("{}: {}\n".format(label, ','.join([str(x) for x in t])))