F_beta: F_beta

Description Usage Arguments Examples

View source: R/hypergate.R

Description

Compute a F_beta score comparing two boolean vectors

Usage

1
F_beta(pred, truth, beta = 1)

Arguments

pred

boolean vector of predicted values

truth

boolean vector of true values

beta

Weighting of yield as compared to precision. Increase beta so that the optimization favors yield, or decrease to favor purity.

Examples

1
2
3
4
5
6
7
8
9
data(Samusik_01_subset)
truth=c(rep(TRUE,40),rep(FALSE,60))
pred=rep(c(TRUE,FALSE),50)
table(pred,truth) ##40% purity, 50% yield
#' F_beta(pred=pred,truth=truth,beta=2) ##Closer to yield
F_beta(pred=pred,truth=truth,beta=1.5) ##Closer to yield
F_beta(pred=pred,truth=truth,beta=1) ##Harmonic mean
F_beta(pred=pred,truth=truth,beta=0.75) ##Closer to purity
F_beta(pred=pred,truth=truth,beta=0.5) ##Closer to purity

ebecht/hypergate documentation built on March 9, 2020, 4:05 p.m.