Skip to content

Commit 6c3e951

Browse files
fix doctests
1 parent 4db85f5 commit 6c3e951

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

machine_learning/linear_regression_naive.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,14 @@ def mean_absolute_error(predicted_y: np.ndarray, original_y: np.ndarray) -> floa
161161

162162

163163
def main() -> None:
164-
"""Driver function."""
164+
"""Driver function.
165+
166+
>>> main() # doctest: +ELLIPSIS
167+
Iteration 1: Error = ...
168+
... # lots of output omitted
169+
Resultant Feature vector:
170+
...
171+
"""
165172
data = collect_dataset()
166173

167174
len_data = data.shape[0]
@@ -170,7 +177,7 @@ def main() -> None:
170177

171178
theta = run_linear_regression(data_x, data_y)
172179
print("Resultant Feature vector:")
173-
for value in theta.ravel():
180+
for value in np.asarray(theta).ravel():
174181
print(f"{value:.5f}")
175182

176183

0 commit comments

Comments
 (0)