This function computes an ensemble score using Item Response Theory (IRT). This was proposed as an ensemble method for anomaly/outlier detection in Kandanaarachchi (2021) <doi:10.13140/RG.2.2.18355.96801>.

irt_ensemble(X)

Arguments

X

The input data containing the outlier scores in a dataframe, matrix or tibble format. Rows contain observations and columns contain outlier detection methods.

Value

A list with the components:

scores

The ensemble scores.

model

The IRT model.

Details

For outlier detection, higher ensemble scores indicate higher levels of anomalousness. This ensemble uses IRT's latent trait to uncover the hidden ground truth, which is used as the ensemble score. It uses the R packages airt and EstCRM to fit the IRT models. It can also be used for other ensembling tasks.

Examples

set.seed(123) X <- data.frame(x1 = rnorm(200), x2 = rnorm(200)) X[199, ] <- c(4, 4) X[200, ] <- c(-3, 5) y1 <- DDoutlier::KNN_AGG(X) y2 <- DDoutlier::LOF(X) y3 <- DDoutlier::COF(X) y4 <- DDoutlier::INFLO(X) y5 <- DDoutlier::KDEOS(X) y6 <- DDoutlier::LDF(X) y7 <- DDoutlier::LDOF(X) Y <- cbind.data.frame(y1, y2, y3, y4, y5, y6, y7) ens <- irt_ensemble(Y) ens$scores
#> [1] 2.7499700 1.4101214 2.3851865 1.2887506 1.0411776 2.6205508 2.5546400 #> [8] 1.5881365 2.0104587 1.2330647 0.5170801 1.7400656 2.0777206 0.4035411 #> [15] 0.7880822 1.8615165 1.1698637 4.3532378 3.4331847 1.6023198 1.6215328 #> [22] 1.8383450 1.6344314 1.3146771 2.9598660 1.3109984 1.0379999 1.7334402 #> [29] 1.2061924 4.0200577 3.0216700 1.5130419 1.1042007 1.0711869 1.6398688 #> [36] 3.1279216 1.5142230 1.5262011 1.3530642 1.4804622 1.4668338 1.0686940 #> [43] 2.4431809 2.6814195 2.0533518 2.3782576 1.7286403 1.5068687 1.4084763 #> [50] 1.6619282 1.1396438 1.4567697 1.9674153 1.5239649 1.6940550 2.0055778 #> [57] 3.0593897 1.8327251 1.7146556 1.8780748 1.1321352 2.2046926 1.1639819 #> [64] 1.2247894 2.7118413 2.3051998 0.8341424 1.5069212 1.8715783 3.2812728 #> [71] 1.5422629 4.2498156 2.4203946 1.3861550 0.7765069 2.2334185 0.9217082 #> [78] 1.7247439 1.7796229 1.7623622 1.8797413 1.1208158 1.8231548 1.6139695 #> [85] 1.4635352 0.8924499 1.6458295 2.5699644 2.2137228 1.3908758 2.9109346 #> [92] 1.5266184 1.9697309 1.5254419 2.5468103 3.2521986 2.0797850 2.5310348 #> [99] 0.3671396 0.8411122 1.4385610 2.0000269 1.3380764 1.1382760 1.5347585 #> [106] 1.8927201 3.0553032 1.3064383 1.4913842 2.8394999 1.3542946 0.7767300 #> [113] 4.1990590 1.5171068 1.2431551 1.8408044 2.0325404 1.6446403 2.2547875 #> [120] 1.0887962 1.5614891 0.8988602 1.4824054 2.0447247 2.4125520 1.4658528 #> [127] 1.6532684 1.5090490 1.0587958 2.2097953 3.3379317 2.3001543 1.2376344 #> [134] 1.7907484 3.9616564 2.9472313 4.2959349 1.6891682 1.8940684 0.0000000 #> [141] 1.3789457 1.8659944 3.2198402 1.7181771 1.4000883 2.6502220 1.6459582 #> [148] 0.9872066 2.3915488 1.7936844 2.0347076 2.9165422 1.1974528 2.3018889 #> [155] 1.7380236 1.3101732 1.3581547 0.6791827 3.7751029 3.4279248 2.1735347 #> [162] 1.8655725 1.6222480 3.6891683 1.7675549 1.7284564 1.8969481 1.2769136 #> [169] 1.0964760 1.3495868 2.9273093 1.9795798 1.0908994 1.9114851 1.9951762 #> [176] 1.5860982 2.4176013 1.1282068 1.0593839 2.6421120 1.8746779 0.6232118 #> [183] 0.6575514 1.9337888 1.5224516 1.1869665 1.6645790 2.7145856 0.4023884 #> [190] 2.7427898 1.6885193 2.0299680 2.2126206 1.0813943 1.7276205 2.1213439 #> [197] 1.8394860 1.9045083 5.9386925 9.5796414