comparison tvii/logistic_regression.py @ 16:b95fe82ac9ce

more notes to self
author Jeff Hammel <k0scist@gmail.com>
date Sun, 03 Sep 2017 13:17:33 -0700
parents 8cb116d63a78
children 3713c6733990
comparison
equal deleted inserted replaced
15:926c127305fa 16:b95fe82ac9ce
10 [z1 z2 z3 .. zm] = w'*X + [b b b b ] = [w'*x1+b + w'*x2+b ...] 10 [z1 z2 z3 .. zm] = w'*X + [b b b b ] = [w'*x1+b + w'*x2+b ...]
11 """ 11 """
12 12
13 13
14 import numpy as np 14 import numpy as np
15 from .sigmoid import sigmoid
16
17 def cost_function(_):
18 """
19 Cost function for binary classification
20 yhat = sigmoid(W.T*x + b)
21 interpret yhat thhe probably that y=1
22
23 Loss function:
24 y log(yhat) + (1- {UNFINISHED})
25 """
26 raise NotImplementedError('TODO')
15 27
16 def logistic_regression(_): 28 def logistic_regression(_):
17 """the slow way""" 29 """the slow way"""
18 J = 0 30 J = 0
19 dw1 =0 31 dw1 =0