Learn R Programming

RobustMetrics (version 0.1.1)

robFScore: Robust F-Beta Score

Description

Compute a robust version of the F-Beta Score.

Usage

robFScore(
  actual = NULL,
  predicted = NULL,
  TP = NULL,
  FN = NULL,
  FP = NULL,
  TN = NULL,
  beta = 1,
  d0 = 0.1
)

Value

robust F-Beta Score.

Arguments

actual

A vector of actual values (1/0 or TRUE/FALSE)

predicted

A vector of prediction values (1/0 or TRUE/FALSE)

TP

Count of true positives (correctly predicted 1/TRUE)

FN

Count of false negatives (predicted 0/FALSE, but actually 1/TRUE)

FP

Count of false positives (predicted 1/TRUE, but actually 0/FALSE)

TN

Count of true negatives (correctly predicted 0/FALSE)

beta

Beta squared is the weight of recall in the harmonic mean

d0

Weight of the estimated true positive probability in the harmonic mean

Details

Calculate the robust F-Beta Score \(F_{\beta,d_0}\) with two parameters. Provide either:

  • actual and predicted or

  • TP, FN, FP and TN.

If \(d_0=0\), the robust F-Beta Score coincides with the F-Beta Score.

References

Holzmann, H., Klar, B. (2024). Robust performance metrics for imbalanced classification problems. arXiv:2404.07661. LINK

Examples

Run this code
actual <-    c(1,1,1,1,1,1,0,0,0,0)
predicted <- c(1,1,1,1,0,0,1,0,0,0)
robFScore(actual, predicted, beta=1, d0=0.1)
robFScore(TP=4, FN=2, FP=1, TN=3, beta=1, d0=1)

Run the code above in your browser using DataLab