Skip to content

Commit a9acf07

Browse files
committed
correct spacing according to PEP8
1 parent 2093ea6 commit a9acf07

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

machine_learning/logistic_regression.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ def logistic_reg(
4848
z = np.dot(X, theta)
4949
h = sigmoid_function(z)
5050
gradient = np.dot(X.T, h - y) / y.size
51-
theta = theta - alpha * gradient # updating the weights
51+
theta = theta - alpha * gradient # updating the weights
5252
z = np.dot(X, theta)
5353
h = sigmoid_function(z)
5454
J = cost_function(h, y)
5555
if iterations % 100 == 0:
56-
print(f'loss: {J} \t') # printing the loss after every 100 iterations
56+
print(f'loss: {J} \t') # printing the loss after every 100 iterations
5757
return theta
5858

5959
# In[68]:
@@ -65,11 +65,11 @@ def logistic_reg(
6565

6666
alpha = 0.1
6767
theta = logistic_reg(alpha,X,y,max_iterations=70000)
68-
print("theta: ",theta) # printing the theta i.e our weights vector
68+
print("theta: ",theta) # printing the theta i.e our weights vector
6969

7070

7171
def predict_prob(X):
72-
return sigmoid_function(np.dot(X, theta)) # predicting the value of probability from the logistic regression algorithm
72+
return sigmoid_function(np.dot(X, theta)) # predicting the value of probability from the logistic regression algorithm
7373

7474

7575
plt.figure(figsize=(10, 6))

0 commit comments

Comments
 (0)