Skip to content

Commit afbfbe5

Browse files
authored
Update ordinary_least_squares_regression.py
1 parent fc7b0d4 commit afbfbe5

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

machine_learning/ordinary_least_squares_regression.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
and it is based on the principle of minimizing
88
the sum of the squared residuals.
99
10-
Below is simple implementation of OLSR
10+
Below is a simple implementation of OLSR
1111
without using any external libraries.
1212
1313
WIKI: https://en.wikipedia.org/wiki/Ordinary_least_squares
@@ -21,8 +21,8 @@ def ols_regression(x_point: np.ndarray, y_point: np.ndarray) -> tuple:
2121
Performs Ordinary Least Squares Regression (OLSR) on the given data.
2222
2323
Args:
24-
x (numpy.ndarray): The independent variable.
25-
y (numpy.ndarray): The dependent variable.
24+
x: The independent variable.
25+
y: The dependent variable.
2626
2727
Returns:
2828
a (float): The intercept of the regression line.
@@ -34,7 +34,7 @@ def ols_regression(x_point: np.ndarray, y_point: np.ndarray) -> tuple:
3434
>>> a, b = ols_regression(x, y)
3535
>>> float(a) # Intercept should be 0.0
3636
0.0
37-
>>> round(b, 2) # Slope should be 2.0
37+
>>> float(round(b, 2)) # Slope should be 2.0
3838
2.0
3939
"""
4040

0 commit comments

Comments
 (0)