get_anomalies: Retrieve anomalies

Description Usage Arguments Examples

View source: R/get_anomalies.R

Description

Based on a summary normalized/stacked metric, retrieve top anomalies.

Usage

1
2
get_anomalies(x, rank.prop = 0.05, nmin = 10, nmax = 300,
  stack.use = "avg", method.use = "norm", verbose = TRUE, ...)

Arguments

x

stranger object (before of after singularize)

rank.prop

proportion of records to be considered as anomalies

nmin

constraint - minimum number of anomalies

nmax

constrait - maximum number of anomalies

stack.use

One of c("max","avg","min","damavg", "pruavg")) - must have been requestedwhen invoking 'singularize' (done by default).

method.use

One of c("norm","rank") - must have been requestedwhen invoking 'singularize' (done by default).

verbose

logical: provide some information.

...

additional parameters to pass to singularize (if called on a non-singularized object)

Anomalies selection is performed using one summary metric. This summary metrics is assumed to stacked some base metrics - may be only one!. Stacking is performed after standardisation, being possible with two approaches: normalisation (method.use = "norm") or ranking (method.use = "rank"). See singularize function.

Three parameters are used together to define anomalies: rank.prop is firsu used to filter on top x% anomalies then one applies on top of this criteria conditions on a minimal (nmin) and maximal (nmax) number of anomalies to be provided.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data <- crazyfy(iris[,1:4])
(anom <- get_anomalies(strange(data)))
## Not run: 
library(dplyr)
ss <- iris %>% select(-Species) %>%
 crazyfy() %>%
 strange(weird="autoencode") %>%
 singularize(methods="norm",stacks="avg")
 anom2 <- ss %>% get_anomalies(nmin=2, nmax=4)
 ss %>% plot(type="n",score="N_anom_norm_avg",anomaly_id=anom2[1])

## End(Not run)

stranger documentation built on March 18, 2018, 2:01 p.m.