btloda: This function returns the anomaly scores, the projections and...

Description Usage Arguments Value Examples

View source: R/btloda.R

Description

This function returns the anomaly scores, the projections and histograms built from using bootstrap and out-of-bag version of loda

Usage

1
btloda(a, sparsity = NA, maxk = 1000, inf_replace = log(1e-09))

Arguments

a

Input dataframe or data matrix

sparsity

The proportion of the dimensions assigned to be 0 when build each random projection. Default is NA, in which case if the data dimension d > 1, 1 - d^{-1/2} proportion of dimensions will be set to 0, and if d = 1, no dimension will be set to 0.

maxk

The number of projections/histograms we want to build.

inf_replace

The quantity to use to replace the possible negative infinity got from calculating log density based on the histograms built. Default is log(1e-09).

Value

A list consisting of the anomaly scores, the projections and histograms built.

Examples

1
2
3
4
5
a = matrix(rnorm(200, 0, 1), nrow = 20, ncol = 10)
bt_out = btloda(a,sparsity=NA, maxk=1000, inf_replace = log(1e-09))
bt_out$oob_nll 
bt_out$pvh$w
bt_out$pvh$hists

liusi2019/btloda documentation built on Feb. 2, 2020, 5:31 a.m.