Skip to content

Commit 9a25b83

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 5cb554d commit 9a25b83

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

machine_learning/pearson_correlation.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ def pearson_correlation(data_x: np.ndarray, data_y: np.ndarray) -> float:
4545
y_mean = np.mean(data_y)
4646

4747
numerator = np.sum((data_x - x_mean) * (data_y - y_mean))
48-
denominator = np.sqrt(np.sum((data_x - x_mean) ** 2) * np.sum((data_y - y_mean) ** 2))
48+
denominator = np.sqrt(
49+
np.sum((data_x - x_mean) ** 2) * np.sum((data_y - y_mean) ** 2)
50+
)
4951

5052
if denominator == 0:
5153
raise ValueError("Standard deviation of input arrays must not be zero.")

0 commit comments

Comments
 (0)