We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 29fb882 commit 1629c4cCopy full SHA for 1629c4c
machine_learning/linear_regression.py
@@ -41,7 +41,7 @@ def ols_linear_regression(data_x: np.ndarray, data_y: np.ndarray) -> np.ndarray:
41
data_x = np.c_[np.ones(data_x.shape[0]), data_x].astype(float)
42
43
# Use NumPy's built-in function to solve the linear regression problem
44
- theta = np.linalg.inv(data_x.T.dot(data_x)).dot(data_x.T).dot(data_y)
+ theta = np.linalg.inv(data_x.T @ data_x) @ data_x.T @ data_y
45
46
return theta
47
0 commit comments