Skip to contents

Calculates the F1 score as the harmonic mean of user's accuracy (UA) and producer's accuracy (PA). If standard errors of UA and PA are provided, the standard error of the F1 score is calculated using first-order uncertainty propagation.

Usage

aa_f1(ua, pa, ua_se = NULL, pa_se = NULL)

Arguments

ua

User's accuracy

pa

Producer's accuracy

ua_se

Standard error of user's accuracy

pa_se

Standard error of producer's accuracy

Value

A data.frame containing two numeric vectors:

  • f1: The F1 score.

  • f1_se: The standard error of the F1 score. This is NULL if ua_se or pa_se is not provided.

Details

$$F_1 = \frac{2 \times UA \times PA}{UA + PA}$$

The standard error is calculated as:

$$SE(F_1) = \sqrt{\frac{4 \times \left(SE(UA)^2 \times PA^4 + SE(PA)^2 \times UA^4\right)}{(UA + PA)^4}}$$

This calculation assumes that UA and PA are statistically independent and therefore does not include a covariance term.

Author

Dirk Pflugmacher