Learn R Programming

dprep (version 3.0.2)

baysout: Outlier detection using Bay and Schwabacher's algorithm.

Description

This function implements the algorithm for outlier detection found in Bay and Schwabacher(2003). The algorithm assigns an outlyingness measure to each observation and returns the indexes of those observations having the largest measures. The number of outliers to be returned is specified by the user.

Usage

baysout(D, blocks = 10, nclass=0, k = 3, num.out = 10)

Arguments

D
the dataset under study
blocks
the number of sections in which to divide the entire dataset. It must be at least as large as the number of outliers requested.
nclass
To find the outliers without taking in cnsideration the feature class enter 0. To find the outliers for a given class enter the class number.
k
the number of neighbors to find for each observation
num.out
the number of outliers to return

Value

num.out
Returns a two column matrix containing the indexes of the observations with the top num.out outlyingness measures. A plot of the top candidates and their measures is also displayed.

References

Bay, S.D., and Schwabacher (2003). Mining distance-based outliers in near linear time with randomization and a simple pruning rule.

Examples

Run this code
#---- Outliers detection using the Bay's algorithm----
data(bupa)
bupa.out=baysout(bupa[bupa[,7]==1,1:6],blocks=10,num.out=10)

Run the code above in your browser using DataLab