Learn R Programming

recommenderlab (version 1.0.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)

Value

The error value.

Arguments

true

true values.

predicted

predicted values

na.rm

ignore missing values.

Details

Frobenius norm requires matrices.

Examples

Run this code
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