Skip to contents

The mean absolute error computed separately for presences and for absences/background points and then averaged: (mean(1 - pred | presence) + mean(pred | absence)) / 2. The plain MAE is dominated by whichever class has more points; with many background points (e.g. 10 000) it mostly rewards predicting low values everywhere, i.e. narrow models. MAEbal weighs both classes equally (as with a prevalence of 0.5) and so does not depend on the number of background points. Lower is better. With background points it does not turn the background into absences: it only balances the two classes, so with presence-background data it measures how well predictions separate presences from background, not the error of occurrence probabilities.

Usage

mae_balanced(obs, pred)

Arguments

obs

Numeric vector of observations (1 = presence, 0 = absence).

pred

Numeric vector of predicted suitability.

Details

Status and what to vary. MAE (Konowalik & Nosol 2021) balanced between the classes in preENM. Compare it with the plain MAE: if the two rank models differently, the ranking depends on the number of background points.

References

Konowalik, K., Nosol, A. (2021) Evaluation metrics and validation of presence-only species distribution models based on distributional maps with varying coverage. Scientific Reports 11, 1482. doi:10.1038/s41598-020-80062-1

Examples

obs <- c(1, 1, rep(0, 98))
narrow <- c(0.6, 0.6, rep(0, 98))
mae_score(obs, narrow)      # looks excellent: background dominates
#> [1] 0.008
mae_balanced(obs, narrow)   # presences count as much as background
#> [1] 0.2