Learn R Programming

recommenderlab (version 0.2-6)

Error: Error Calculation

Description

Calculate the mean absolute error (MAE), mean square error (MSE), root mean square error (RMSE) and for matrices also the Frobenius norm (identical to RMSE).

Usage

MSE(true, predicted, na.rm = TRUE)
RMSE(true, predicted, na.rm = TRUE)
MAE(true, predicted, na.rm = TRUE)
frobenius(true, predicted, na.rm = TRUE)

Arguments

true

true values.

predicted

predicted values

na.rm

ignore missing values.

Value

The error value.

Details

Frobenius norm requires matrices.

Examples

Run this code
# NOT RUN {
true <- rnorm(10)
predicted <- rnorm(10)

MAE(true, predicted)
MSE(true, predicted)
RMSE(true, predicted)

true <- matrix(rnorm(9), nrow = 3)
predicted <- matrix(rnorm(9), nrow = 3)

frobenius(true, predicted)
# }

Run the code above in your browser using DataLab