Root Mean Squared Error
MediumMachine LearningMathArrayTree
Description
Given equal-length arrays yTrue and yPred, return the root mean squared error (square root of the mean squared error), rounded to 4 decimal places.
Examples
Input:
yTrue = [1,2,3], yPred = [1,2,3]Output:
0Explanation:
Taking the square root of the mean squared error gives 0.
Input:
yTrue = [3,5,2], yPred = [2,5,4]Output:
1.291Explanation:
Taking the square root of the mean squared error gives 1.291.
Input:
yTrue = [0,0], yPred = [2,2]Output:
2Explanation:
Taking the square root of the mean squared error gives 2.
Constraints
- •
1 ≤ yTrue.length ≤ 10⁴