Evaluate predictions using the Mean Squared Error
Source:R/evaluation_EvaluatorMAE_MSE.R
EvaluatorMSE.Rd
Compute the mean squared error of the predictions of a model. For binary classification this corresponds to the Brier-Score.
Arguments
- .prediction
A
data.frame
object 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.data
and the name of the target variable in the.target
argument.- .data
Optional argument, which has to be provided if only the predictions are handed over in
.prediction
,.data
has to be adata.frame
which contains the true values.- .target
If only the predictions are handed over in
.prediction
,.target
has 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