Evaluate predictions using the Mean Squared Error
Source:R/evaluation_EvaluatorMAE_MSE.R
EvaluatorMSE.RdCompute the mean squared error of the predictions of a model. For binary classification this corresponds to the Brier-Score.
Arguments
- .prediction
A
data.frameobject containing the predictions of a model. The columns should contain the predictions and the true values. If only the predictions are handed over, the true values of the target variable have to be handed over in the.dataand the name of the target variable in the.targetargument.- .data
Optional argument, which has to be provided if only the predictions are handed over in
.prediction,.datahas to be adata.framewhich contains the true values.- .target
If only the predictions are handed over in
.prediction,.targethas to be handed over as acharacter. of length 1 being the name of the target variable.
See also
For further Evaluators: EvaluatorMAE(), EvaluatorAIC(), EvaluatorBIC(),
EvaluatorAccuracy(), EvaluatorAUC()
Examples
x <- data.frame(var1 = c(1, 1, 1, 1, 0), target = c(1, 2, 3, 4, 5))
predictions <- c(3)
EvaluatorMSE(predictions, x, "target")
#> [1] 2
predictions <- data.frame(prediction = c(1.3, 2.5, 2.6, 3.5, 4.5), truth = c(1, 2, 3, 4, 5))
EvaluatorMSE(predictions)
#> [1] 0.2