msle: Mean Square Logarithmic Error

Description Usage Arguments Details Examples

Description

Calculate Mean-Square-Logarithmic Error (Deviation)

For the ith sample, Squared Logarithmic Error is calculated as SLE = (log(prediction + 1) - log(actual + 1))^2. MSE is then mean(squared logarithmic errors). Note the '+1' in the calculation of SLE which avoids taking the logarithm of 0 for data which may include 0s.

Usage

1
msle(preds = NULL, actuals = NULL, weights = 1, na.rm = FALSE)

Arguments

preds

A vector of prediction values in [0, 1]

actuals

A vector of actuals values in 0, 1, or FALSE, TRUE

weights

Optional vectors of weights

na.rm

Should (prediction, actual) pairs with at least one NA value be ignored?

Details

Calculate Mean-Square-Logarithmic Error (Deviation)

Examples

1
2
3
preds <- c(1.0, 2.0, 9.5)
actuals <- c(0.9, 2.1, 10.0)
msle(preds, actuals)

mltools documentation built on May 2, 2019, 5:22 a.m.