Root mean squared error (RMSE) is the square root of the average of squared differences between observed and predicted values: RMSE = √mean((observed − predicted)²). Averaging makes errors comparable across datasets of different sizes; taking the square root returns the measure to the target’s units. section 3.4
For house prices, an RMSE of $10,000 suggests predictions are off by around $10,000. A large RMSE is not automatically proof of a bad model: outliers or missing features may contribute to it. section 3.4 section 3.5
Comparing models on test data
In a polynomial-regression example, testing RMSE is 699.03 without regularization, 10.08 with L1 regularization, and 3.41 with L2 regularization. The lower L2 result indicates better performance in this comparison. section 4.6
def rmse(labels, predictions): n = len(labels) differences = np.subtract(labels, predictions) return np.sqrt(1.0/n * (np.dot(differences, differences)))
See a short Python function that calculates RMSE from labels and predictions. section 3.4






