Skip to content

Commit bb00bdc

Browse files
authored
Update loss_functions.py
1 parent fee0797 commit bb00bdc

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

machine_learning/loss_functions.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ def root_mean_squared_error(y_true: np.array, y_pred: np.array) -> float:
690690
>>> true_labels = [2, 4, 6, 8]
691691
>>> predicted_probs = [3, 5, 7, 10]
692692
>>> round(root_mean_squared_error(true_labels, predicted_probs), 4)
693-
1.3229
693+
1.3228756555322954
694694
695695
>>> true_labels = np.array([1.0, 2.0, 3.0, 4.0, 5.0])
696696
>>> predicted_probs = np.array([0.3, 0.8, 0.9, 0.2])
@@ -701,7 +701,6 @@ def root_mean_squared_error(y_true: np.array, y_pred: np.array) -> float:
701701
"""
702702
if len(y_true) != len(y_pred):
703703
raise ValueError("Input arrays must have the same length.")
704-
y_true, y_pred = np.array(y_true), np.array(y_pred)
705704

706705
mse = np.mean((y_pred - y_true) ** 2)
707706
return np.sqrt(mse)

0 commit comments

Comments
 (0)