loss_function_rmse
Loss function: Root Mean Square Error.
rmse = loss_function_rmse(y_true, y_pred)
Input variables
Name | Description | Type |
---|---|---|
y_true | True values | List |
y_pred | Predicted values | List |
Output variables
Name | Description | Type |
---|---|---|
rmse | Root Mean Square Error | Float |
Problem
(1) |
Example 1
Considering the true values
# Data
y_true_example = [1.0, 2.0, 3.0, 4.0, 5.0]
y_pred_example = [1.2, 2.3, 2.9, 4.2, 5.3]
# Call function
rmse_value = loss_function_rmse(y_true_example, y_pred_example)
# Print the result
print("Root Mean Square Error (RMSE): {:.4f}".format(rmse_value))
Root Mean Square Error (RMSE): 0.2324