Skip to content

Commit 0181e65

Browse files
committed
add import statement in doctest
1 parent 9da2715 commit 0181e65

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

machine_learning/logistic_regression.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def log_likelihood(x, y, weights):
113113
weights (ndarray): shape (n_features,) parameter vector
114114
115115
Examples:
116+
>>> import numpy as np
116117
>>> x = np.array([[0, 0, 0]])
117118
>>> y = np.array([0, 0, 0])
118119
>>> w = np.array([0, 0, 0])
@@ -156,6 +157,7 @@ def logistic_reg(alpha, x, y, max_iterations=70000):
156157
Learned weight vector after optimization.
157158
158159
Examples:
160+
>>> import numpy as np
159161
>>> alpha = 0.001
160162
>>> x = np.ones((2, 2))
161163
>>> y = np.ones(2)

0 commit comments

Comments
 (0)