Updated the comments.
This commit is contained in:
parent
21cc1b1ca0
commit
c81789fbd3
1 changed files with 2 additions and 2 deletions
|
|
@ -87,8 +87,8 @@ class LogisticRegression:
|
||||||
y_batch = self.y[idx]
|
y_batch = self.y[idx]
|
||||||
# it returns X and Y batch values from a randomly permuted indices from start to end
|
# it returns X and Y batch values from a randomly permuted indices from start to end
|
||||||
|
|
||||||
z = x_batch.dot(self.w)
|
z = x_batch.dot(self.w) # linear prediction
|
||||||
p = self.sigmoid(z)
|
p = self.sigmoid(z) # probabilities of the model predictions
|
||||||
|
|
||||||
grad = x_batch.T.dot(p - y_batch) / y_batch.size # gradient calculation formula
|
grad = x_batch.T.dot(p - y_batch) / y_batch.size # gradient calculation formula
|
||||||
self.w -= self.lr * grad # gradient multiplied by learning rate is removed from weight
|
self.w -= self.lr * grad # gradient multiplied by learning rate is removed from weight
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue