GetOutRates: GetOutRates

Description Usage Arguments Value Author(s) Examples

View source: R/GetRate.R

Description

The function calculates two rates - True Positive and False Positive Rates (TPR and FPR) - in order to evaluate the performance of an outlier detection method. Both rates range between zero and one.

Usage

1
GetOutRates(label, predict, out = "out")

Arguments

label

The numeric (character) vector containing the outlier memberhip, e.g. 1: non-outliers, 0: outliers

predict

The numeric (character) vector consisting of values refering the outlier memberhip predicted by an outlier dection method, e.g. 1: declared as non outliers, 0: identified as outliers

out

a numeric (character) value corresponding to the value indicating outliers, e.g. out=0

Value

The function returns list of two values

TPR

The true positive rate is defined as the ration between the number of correctly idenitified outliers and the number of actual outliers. TPR=1 means that all outliers are correctly identified.

FPR

The false positive rate is calculated as the number of wrongly identified outliers devided by the total number of actual non-outliers. FPR=0 means that no non-outlier is decleared as outlier.

Author(s)

Sarka Brodinova <sarka.brodinova@tuwien.ac.at>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# generate data
d <- SimData(size_grp=c(40,40,40),p_inf=50,
p_noise=750,p_out_noise=75)
dat <- scale(d$x)
lb <- d$lb
table(lb) # outliers have zero group memberhsip

res <- wrsk(data=dat,k=3,s=6)
table(d$lb,res$outclusters)

GetOutRates(lb,res$outclusters)

brodsa/wrsk documentation built on April 7, 2020, 6:12 a.m.