View source: R/get_anomalies.R
get_anomalies | R Documentation |
Based on a summary normalized/stacked metric, retrieve top anomalies.
get_anomalies( x, rank.prop = 0.05, nmin = 10, nmax = 300, stack.use = "avg", method.use = "norm", verbose = TRUE, ... )
x |
stranger object (before of after singularize) |
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 requested when 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 standardisarion, being possible with two approaches: normalisation ( Three parameters are used together to define anomalies: rank.prop is first used to filter on top x percent anomalies then one applies on top of this criteria conditions on a minimal ( |
rank.prop: |
proportion of records to be considered as anomalies |
nmin: |
constraint - minimum number of anomalies |
nmax: |
constraint - maximum number of anomalies |
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.