Skip to content

Commit e879c47

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 11fa072 commit e879c47

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

machine_learning/linear_regression_naive.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@ def collect_dataset() -> np.ndarray:
4141

4242

4343
def run_steep_gradient_descent(
44-
data_x: np.ndarray, data_y: np.ndarray, len_data: int, alpha: float, theta: np.ndarray
44+
data_x: np.ndarray,
45+
data_y: np.ndarray,
46+
len_data: int,
47+
alpha: float,
48+
theta: np.ndarray,
4549
) -> np.ndarray:
4650
"""Run one step of steep gradient descent.
4751

machine_learning/linear_regression_vectorized.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def gradient_descent(
6161

6262
if i % (iterations // 10) == 0: # log occasionally
6363
cost = np.sum(errors**2) / (2 * m)
64-
print(f"Iteration {i+1}: Error = {cost:.5f}")
64+
print(f"Iteration {i + 1}: Error = {cost:.5f}")
6565

6666
return theta
6767

@@ -96,4 +96,3 @@ def main() -> None:
9696

9797
doctest.testmod()
9898
main()
99-

0 commit comments

Comments
 (0)