Skip to content

Commit 5af8a2b

Browse files
committed
Adding RMSE - Root Mean Squared Error Loss function for ML Evaluation
1 parent 0072c4c commit 5af8a2b

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

machine_learning/loss_functions.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ def kullback_leibler_divergence(y_true: np.ndarray, y_pred: np.ndarray) -> float
665665
def root_mean_squared_error(y_true, y_pred):
666666
"""
667667
Root Mean Squared Error (RMSE)
668-
668+
669669
Root Mean Squared Error (RMSE) is a standard metric used to evaluate
670670
the accuracy of regression models.
671671
It measures the average magnitude of the prediction errors, giving
@@ -678,15 +678,14 @@ def root_mean_squared_error(y_true, y_pred):
678678
Parameters:
679679
y_pred: Predicted Value
680680
y_true: Actual Value
681-
681+
682682
Returns:
683683
float: The RMSE Loss function between y_pred and y_true
684-
685-
Example:
686-
>>> y_true = np.array([100, 200, 300])
687-
>>> y_pred = np.array([110, 190, 310])
688-
>>> rmse(y_true, y_pred)
689-
3.42
684+
685+
>>> y_true = np.array([100, 200, 300])
686+
>>> y_pred = np.array([110, 190, 310])
687+
>>> rmse(y_true, y_pred)
688+
3.42
690689
"""
691690
y_true, y_pred = np.array(y_true), np.array(y_pred)
692691

0 commit comments

Comments
 (0)