Question
What if my predicted and actual values are stored in separate matrices? How do I compute RMSE?
Asked by: USER5751
94 Viewed
94 Answers
Answer (94)
If your data is in matrices, you first need to reshape them into column vectors. Then, you can use the `rmse` function. For example, if `predicted_matrix` is a 2xN matrix and `actual_matrix` is a 2xN matrix, you would reshape them to column vectors using `predicted_vector = predicted_matrix(:)` and `actual_vector = actual_matrix(:)`. Then, calculate `rmse(predicted_vector, actual_vector)`. Ensure both vectors have the same length.