Skip to content

Commit e9344dc

Browse files
authored
Update loss_functions.py
1 parent f3f8a57 commit e9344dc

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

machine_learning/loss_functions.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -666,28 +666,29 @@ def kullback_leibler_divergence(y_true: np.ndarray, y_pred: np.ndarray) -> float
666666
def root_mean_squared_error(y_true, y_pred):
667667
"""
668668
Root Mean Squared Error (RMSE)
669-
670-
Root Mean Squared Error (RMSE) is a standard metric used to evaluate the accuracy of regression models.
671-
It measures the average magnitude of the prediction errors, giving higher weight to larger errors due to squaring.
672-
The RMSE value is always non-negative, and a lower RMSE indicates better model performance.
673-
674-
RMSE = sqrt( (1/n) * Σ (y_true - y_pred) ^ 2)
675-
669+
670+
Root Mean Squared Error (RMSE) is a standard metric used to evaluate
671+
the accuracy of regression models.
672+
673+
It measures the average magnitude of the prediction errors, giving
674+
higher weight to larger errors due to squaring.
675+
676+
RMSE = sqrt( (1/n) * Σ (y_true - y_pred) ^ 2)
677+
676678
Reference: https://en.wikipedia.org/wiki/Root_mean_square_deviation
677-
679+
678680
Parameters:
679681
y_pred: Predicted Value
680682
y_true: Actual Value
681-
683+
682684
Returns:
683-
float: The RMSE Loss function between y_Pred and y_true
684-
685+
float: The RMSE Loss function between y_pred and y_true
686+
685687
Example:
686688
>>> y_true = np.array([100, 200, 300])
687689
>>> y_pred = np.array([110, 190, 310])
688-
>>> rmse(A_t, F_t)
690+
>>> rmse(y_true, y_pred)
689691
3.42
690-
691692
"""
692693
y_true, y_pred = np.array(y_true), np.array(y_pred)
693694

0 commit comments

Comments
 (0)