MyNixOS website logo
Description

A Collection of Outlier Ensemble Algorithms.

Ensemble functions for outlier/anomaly detection. There is a new ensemble method proposed using Item Response Theory. Existing outlier ensemble methods from Schubert et al (2012) <doi:10.1137/1.9781611972825.90>, Chiang et al (2017) <doi:10.1016/j.jal.2016.12.002> and Aggarwal and Sathe (2015) <doi:10.1145/2830544.2830549> are also included.

outlierensembles

R-CMD-check

outlierensembles provides a collection of outlier/anomaly detection ensembles. Given the anomaly scores of different anomaly detection methods, the following ensemble techniques can be used to construct an ensemble score:

  1. Item Response Theory based ensemble discussed in Kandanaarachchi (2021)
  2. Greedy ensemble discussed in Schubert et al. (2012)
  3. Inverse Cluster Weighted Averaging (ICWA) method discussed in Chiang (2017)
  4. Using Maximum scores discussed in Aggarwal and Sathe (2015)
  5. Using a threshold sum discussed in Aggarwal and Sathe (2015)
  6. Using the mean as the ensemble score

Installation

You can install the released version of outlierensembles from CRAN with:

install.packages("outlierensembles")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("sevvandi/outlierensembles")

Example

We use 7 anomaly detection methods from DDoutlier R package as our base methods. You can use any anomaly detection method you want to build the ensemble. First, we construct the IRT ensemble. The colors show the ensemble scores.

faithfulu <- scale(faithful)

y1 <- DDoutlier::KNN_AGG(faithfulu)
y2 <- DDoutlier::LOF(faithfulu)
y3 <- DDoutlier::COF(faithfulu)
y4 <- DDoutlier::INFLO(faithfulu)
y5 <- DDoutlier::KDEOS(faithfulu)
y6 <- DDoutlier::LDF(faithfulu)
y7 <- DDoutlier::LDOF(faithfulu)
Y <- cbind.data.frame(y1, y2, y3, y4, y5, y6, y7)
ens1 <- irt_ensemble(Y)
#> Warning in sqrt(diag(solve(Hess))): NaNs produced
df <- cbind.data.frame(faithful, ens1$scores)
colnames(df)[3] <- "IRT"
ggplot(df, aes(eruptions, waiting)) + geom_point(aes(color=IRT))  +  scale_color_gradient(low="yellow", high="red") 

Then we do the greedy ensemble.

ens2 <- greedy_ensemble(Y)
df <- cbind.data.frame(faithful, ens2$scores)
colnames(df)[3] <- "Greedy"
ggplot(df, aes(eruptions, waiting)) + geom_point(aes(color=Greedy)) +  scale_color_gradient(low="yellow", high="red") 

We do the ICWA ensemble next.

ens3 <- icwa_ensemble(Y)
df <- cbind.data.frame(faithful, ens3)
colnames(df)[3] <- "ICWA"
ggplot(df, aes(eruptions, waiting)) + geom_point(aes(color=ICWA)) +  scale_color_gradient(low="yellow", high="red") 

Next, we use the maximum scores to build the ensemble.

ens4 <- max_ensemble(Y)
df <- cbind.data.frame(faithful, ens4)
colnames(df)[3] <- "Max"
ggplot(df, aes(eruptions, waiting)) + geom_point(aes(color=Max)) +  scale_color_gradient(low="yellow", high="red") 

Then, we use the a threshold sum to construct the ensemble.

ens5 <- threshold_ensemble(Y)
df <- cbind.data.frame(faithful, ens5)
colnames(df)[3] <- "Threshold"
ggplot(df, aes(eruptions, waiting)) + geom_point(aes(color=Threshold)) +  scale_color_gradient(low="yellow", high="red") 

Finally, we use the mean values as the ensemble score.

ens6 <- average_ensemble(Y)
df <- cbind.data.frame(faithful, ens6)
colnames(df)[3] <- "Average"
ggplot(df, aes(eruptions, waiting)) + geom_point(aes(color=Average)) +  scale_color_gradient(low="yellow", high="red") 

References

Aggarwal, Charu C., and Saket Sathe. 2015. “Theoretical Foundations and Algorithms for Outlier Ensembles.” ACM SIGKDD Explorations Newsletter 17 (1): 24–47. https://doi.org/10.1145/2830544.2830549.

Chiang, Alvin et al. 2017. “A study on anomaly detection ensembles.” Journal of Applied Logic 21: 1–13. https://doi.org/10.1016/j.jal.2016.12.002.

Kandanaarachchi, Sevvandi. 2021. “Unsupervised Anomaly Detection Ensembles Using Item Response Theory.” https://arxiv.org/abs/2106.06243.

Schubert, Erich, Remigius Wojdanowski, Arthur Zimek, and Hans Peter Kriegel. 2012. “On evaluation of outlier rankings and outlier scores.” In Proceedings of the 12th Siam International Conference on Data Mining, Sdm 2012, 1047–58.

Metadata

Version

0.1.0

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows