Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit cf385fb

Browse files
committed
model: slr: Correct reuse of x variable in best_fit_line
Coverity: 294621 Signed-off-by: John Andersen <[email protected]>
1 parent 5c04314 commit cf385fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dffml/model/slr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def best_fit_line(x, y):
4141
(mean_x ** 2) - statistics.mean(matrix_multiply(x, x))
4242
)
4343
b = mean_y - (m * mean_x)
44-
regression_line = [m * x + b for x in x]
44+
regression_line = [m * x_element + b for x_element in x]
4545
accuracy = coeff_of_deter(y, regression_line)
4646
return (m, b, accuracy)
4747

0 commit comments

Comments
 (0)