How to express Root Mean Squared Error as a percentage?
Asked Answered
Y

2

5

I want to compare the result of my prediction with that of another person's prediction. In the article, the author says 'The relative percentage of root mean square (RMS%) was used to evaluate the performance'. This is what I want to compare my prediction to.

Currently I'm calculating the root mean square error, however I don't understand how to express this as a percentage

This is how I calculate my root mean square error using Python

rmse = math.sqrt(mean_squared_error(y_test,y_predict)
Yah answered 24/3, 2019 at 15:0 Comment(2)
This is less of a programming question and more of a statistics question; it might be better off at cross validated! Do you mean you want the RMS error as a percentage of the data value for every data point?Spitfire
Thanks, I'll see what they say there! I'm not entirely sure for your question, the report that I want to compare to expresses one value at 71% and the other value, which he says is more accurate, at 75%.Yah
F
6

Use numpy lib in order to calculate rmspe (How to calculate RMSPE in python using numpy):

rmspe = np.sqrt(np.mean(np.square(((y_true - y_pred) / y_true)), axis=0))
Federica answered 30/12, 2019 at 9:33 Comment(0)
A
0
from sklearn.metrics import mean_squared_error

rmse = np.sqrt(mean_squared_error(actual_values, predictions))

target_range = np.max(actual_values) - np.min(actual_values)

percentage_accuracy = (1.0 - (rmse / target_range)) * 100
Airflow answered 2/7, 2023 at 20:26 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Lalita

© 2022 - 2024 — McMap. All rights reserved.