powered by
Calculate Mean-Square Error (Deviation)
For the ith sample, Squared Error is calculated as SE = (prediction - actual)^2. MSE is then mean(squared errors).
mse(preds = NULL, actuals = NULL, weights = 1, na.rm = FALSE)
A vector of prediction values in [0, 1]
A vector of actuals values in 0, 1, or FALSE, TRUE
Optional vectors of weights
Should (prediction, actual) pairs with at least one NA value be ignored?
https://en.wikipedia.org/wiki/Mean_squared_error
# NOT RUN { preds <- c(1.0, 2.0, 9.5) actuals <- c(0.9, 2.1, 10.0) mse(preds, actuals) # }
Run the code above in your browser using DataLab