changeset 12:8d25213513b4

[regression] notes to self
author Jeff Hammel <k0scist@gmail.com>
date Sun, 03 Sep 2017 11:43:55 -0700
parents b6a146f0a61b
children 8cb116d63a78
files tvii/logistic_regression.py
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tvii/logistic_regression.py	Sun Sep 03 11:27:47 2017 -0700
+++ b/tvii/logistic_regression.py	Sun Sep 03 11:43:55 2017 -0700
@@ -13,6 +13,10 @@
 
 import numpy as np
 
+def logistic_regression(_):
+    """the slow way"""
+    J = 0, dw1=0, dw2=0, db=0;
+
 def logistic_regression(nx):
     dw = np.zeros(nx)
     # TODO
@@ -22,3 +26,10 @@
 # derivativs:
 # dz1 = a1 - y1 ; dz2 = a2 - y2 ; ....
 # dZ = [ dz1 dz2 ... dzm ]
+# Z = w'X + b = np.dot(w', X) + b
+# A sigmoid(Z)
+#dZ = A - Y
+#dw = (1./m)*X*dZ'
+#db = (1./m)*np.sum(dZ)
+# w -= alpha*dw
+# b -= alpha*db