Description Usage Arguments Value References Examples
The package is an R implementation of the Inverse Bagging algorithm. Given two sets: a training one containing observations from a certain distribution and a testing one which can include as well anomalous observations generated from a different unknown distribution. The algorithm returns scores for the testing set observations relating to their anomalous evidence.
| 1 | 
| train | data frame - Data generated by a certain distribution (so-called background). | 
| test | data frame - Data mostly generated by the background with possible signal observations. | 
| Q | numeric - Size of sampled sets, which cannot be larger than the test data size | 
| R | numeric - Method for scores computation: 
 | 
| Mboot | numeric - Number of sampling iterations. | 
A numeric vector of scores for respective observations from the test data set.
Vischia, P. and Tommaso D., "The Inverse Bagging Algorithm: Anomaly Detection by Inverse Bootstrap Aggregating." EPJ Web of Conferences. Vol. 137. EDP Sciences, 2017.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #Generate multivariate data
require(mvtnorm)
set.seed(1)
n <- 2000
B <- 0.05
P <- 4
train <- rmvnorm(n, sigma = diag(P))
#add anomalies with mean shited from sero
test <- rbind(
 rmvnorm(n*(1-B), sigma = diag(P)), 
 rmvnorm(n*B, mean = rep(2,P),sigma = diag(P))
)
#Compute the score
results <- RunInvBag(train, test)
#Plot results
plot(rersults)
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.