average_ensemble.Rd
This function uses the mean as the ensemble score.
average_ensemble(X)
The input data containing the outlier scores in a dataframe, matrix or tibble format. Rows contain observations and columns contain outlier detection methods.
The ensemble scores.
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 <- average_ensemble(Y)
ens
#> [1] 0.15222268 0.07728935 0.14149892 0.13344576 0.19439668 0.14457952
#> [7] 0.22922766 0.11177576 0.16800640 0.14704564 0.07615786 0.14152626
#> [13] 0.11856030 0.22509515 0.12357841 0.10372205 0.18019120 0.36364605
#> [19] 0.22368582 0.08410889 0.07551797 0.14667912 0.16104553 0.08620474
#> [25] 0.24032859 0.12685353 0.08883399 0.13335046 0.12755158 0.29291778
#> [31] 0.22948431 0.24014863 0.21750777 0.12081894 0.15289996 0.22215541
#> [37] 0.14321761 0.13506014 0.12551995 0.21669950 0.09287693 0.19503719
#> [43] 0.20026341 0.22881538 0.18234535 0.16004278 0.14646778 0.08484974
#> [49] 0.10406542 0.14515433 0.18107861 0.10715747 0.21372567 0.14492779
#> [55] 0.17357979 0.18204197 0.28717895 0.11293266 0.10866023 0.13662267
#> [61] 0.13122762 0.16879105 0.27539087 0.06939662 0.21342643 0.14604930
#> [67] 0.12693508 0.09921840 0.13250438 0.29235395 0.11145090 0.38689503
#> [73] 0.24340543 0.16664501 0.14504441 0.18093912 0.19806286 0.14151167
#> [79] 0.22253495 0.16574162 0.09599916 0.09613272 0.18066618 0.13035096
#> [85] 0.22183681 0.09472549 0.09781011 0.15423785 0.23076098 0.07180725
#> [91] 0.22286742 0.13705126 0.16619220 0.11303448 0.19909391 0.27731456
#> [97] 0.20662042 0.20038978 0.26037206 0.06987270 0.07950015 0.15461349
#> [103] 0.11102445 0.16592003 0.18666987 0.17395011 0.26409508 0.17173734
#> [109] 0.11527384 0.23251121 0.17988561 0.08529332 0.35128502 0.12054354
#> [115] 0.19483137 0.13070926 0.12103565 0.15861189 0.17578532 0.13640900
#> [121] 0.22266904 0.08865009 0.06910550 0.13922181 0.14179018 0.09090938
#> [127] 0.18757970 0.13039753 0.09032170 0.17047960 0.23643868 0.19300939
#> [133] 0.20554284 0.14153210 0.28174916 0.22618875 0.32198219 0.14426709
#> [139] 0.14598733 0.12696972 0.11323233 0.22729443 0.27569444 0.07615738
#> [145] 0.11871067 0.17223855 0.10005268 0.17615694 0.18590028 0.21085995
#> [151] 0.14555673 0.20563739 0.11821988 0.15228831 0.14154506 0.13154850
#> [157] 0.14346244 0.17467319 0.33207848 0.26710215 0.19255614 0.20938809
#> [163] 0.20494446 0.33065482 0.12828693 0.21831084 0.14660847 0.10490046
#> [169] 0.11844468 0.09868370 0.22910224 0.09161313 0.15601426 0.17553679
#> [175] 0.21302514 0.07039740 0.17604071 0.08990465 0.18094738 0.16485435
#> [181] 0.12820017 0.08831508 0.21205700 0.23147346 0.24958913 0.08062813
#> [187] 0.19375096 0.20766332 0.19574078 0.25022901 0.17024347 0.21657524
#> [193] 0.23471324 0.17745343 0.15036971 0.10610958 0.21325650 0.13674025
#> [199] 0.66876484 0.87500000