V
- Vector type@Title(value="ABOD: Angle-Based Outlier Detection") @Description(value="Outlier detection using variance analysis on angles, especially for high dimensional data sets.") @Reference(authors="H.-P. Kriegel, M. Schubert, and A. Zimek", title="Angle-Based Outlier Detection in High-dimensional Data", booktitle="Proc. 14th ACM SIGKDD Int. Conf. on Knowledge Discovery and Data Mining (KDD \'08), Las Vegas, NV, 2008", url="http://dx.doi.org/10.1145/1401890.1401946") public class ABOD<V extends NumberVector<V,?>> extends AbstractDistanceBasedAlgorithm<V,DoubleDistance,OutlierResult> implements OutlierAlgorithm
Modifier and Type | Class and Description |
---|---|
static class |
ABOD.Parameterizer<V extends NumberVector<V,?>>
Parameterization class.
|
Modifier and Type | Field and Description |
---|---|
static OptionID |
FAST_SAMPLE_ID
Parameter for sample size to be used in fast mode.
|
private int |
k
k parameter
|
static OptionID |
K_ID
Parameter for k, the number of neighbors used in kNN queries.
|
static OptionID |
KERNEL_FUNCTION_ID
Parameter for the kernel function.
|
private static Logging |
logger
The logger for this class.
|
static OptionID |
PREPROCESSOR_ID
The preprocessor used to materialize the kNN neighborhoods.
|
private PrimitiveSimilarityFunction<? super V,DoubleDistance> |
primitiveKernelFunction
Store the configured Kernel version
|
(package private) int |
sampleSize
Variable to store fast mode sampling value.
|
private ArrayModifiableDBIDs |
staticids |
private static boolean |
useRNDSample
use alternate code below
|
DISTANCE_FUNCTION_ID
Constructor and Description |
---|
ABOD(int k,
int sampleSize,
PrimitiveSimilarityFunction<? super V,DoubleDistance> primitiveKernelFunction,
DistanceFunction<V,DoubleDistance> distanceFunction)
Actual constructor, with parameters.
|
ABOD(int k,
PrimitiveSimilarityFunction<? super V,DoubleDistance> primitiveKernelFunction,
DistanceFunction<V,DoubleDistance> distanceFunction)
Actual constructor, with parameters.
|
Modifier and Type | Method and Description |
---|---|
private double |
calcCos(KernelMatrix kernelMatrix,
DBID aKey,
DBID bKey)
Compute the cosinus value between vectors aKey and bKey.
|
private double |
calcDenominator(KernelMatrix kernelMatrix,
DBID aKey,
DBID bKey,
DBID cKey) |
private PriorityQueue<FCPair<Double,DBID>> |
calcDistsandNN(Relation<V> data,
KernelMatrix kernelMatrix,
int sampleSize,
DBID aKey,
HashMap<DBID,Double> dists) |
private PriorityQueue<FCPair<Double,DBID>> |
calcDistsandRNDSample(Relation<V> data,
KernelMatrix kernelMatrix,
int sampleSize,
DBID aKey,
HashMap<DBID,Double> dists) |
private double[] |
calcFastNormalization(DBID x,
HashMap<DBID,Double> dists) |
private double[] |
calcNormalization(Integer xKey,
HashMap<Integer,Double> dists) |
private double |
calcNumerator(KernelMatrix kernelMatrix,
DBID aKey,
DBID bKey,
DBID cKey) |
private void |
generateExplanation(Relation<V> data,
DBID key,
LinkedList<DBID> expList) |
private double |
getAbofFilter(KernelMatrix kernelMatrix,
DBID aKey,
HashMap<DBID,Double> dists,
double fulCounter,
double counter,
DBIDs neighbors) |
void |
getExplanations(Relation<V> data)
Get explanations for points in the database.
|
OutlierResult |
getFastRanking(Relation<V> relation,
int k,
int sampleSize)
Main part of the algorithm.
|
TypeInformation[] |
getInputTypeRestriction()
Get the input type restriction used for negotiating the data query.
|
protected Logging |
getLogger()
Get the (STATIC) logger for this class.
|
OutlierResult |
getRanking(Relation<V> relation,
int k)
Main part of the algorithm.
|
private int |
mapDBID(DBID aKey) |
OutlierResult |
run(Database database,
Relation<V> relation)
Run ABOD on the data set
|
getDistanceFunction
makeParameterDistanceFunction, run
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
run
private static final Logging logger
public static final OptionID K_ID
public static final OptionID FAST_SAMPLE_ID
public static final OptionID KERNEL_FUNCTION_ID
public static final OptionID PREPROCESSOR_ID
private static final boolean useRNDSample
private int k
int sampleSize
private PrimitiveSimilarityFunction<? super V extends NumberVector<V,?>,DoubleDistance> primitiveKernelFunction
private ArrayModifiableDBIDs staticids
public ABOD(int k, int sampleSize, PrimitiveSimilarityFunction<? super V,DoubleDistance> primitiveKernelFunction, DistanceFunction<V,DoubleDistance> distanceFunction)
k
- k parametersampleSize
- sample sizeprimitiveKernelFunction
- Kernel function to usedistanceFunction
- Distance functionpublic ABOD(int k, PrimitiveSimilarityFunction<? super V,DoubleDistance> primitiveKernelFunction, DistanceFunction<V,DoubleDistance> distanceFunction)
k
- k parameterprimitiveKernelFunction
- kernel function to usedistanceFunction
- Distance functionpublic OutlierResult getRanking(Relation<V> relation, int k)
relation
- Relation to queryk
- k for kNN queriespublic OutlierResult getFastRanking(Relation<V> relation, int k, int sampleSize)
relation
- Relation to usek
- k for kNN queriessampleSize
- Sample sizeprivate double getAbofFilter(KernelMatrix kernelMatrix, DBID aKey, HashMap<DBID,Double> dists, double fulCounter, double counter, DBIDs neighbors)
private double calcCos(KernelMatrix kernelMatrix, DBID aKey, DBID bKey)
kernelMatrix
- aKey
- bKey
- private int mapDBID(DBID aKey)
private double calcDenominator(KernelMatrix kernelMatrix, DBID aKey, DBID bKey, DBID cKey)
private double calcNumerator(KernelMatrix kernelMatrix, DBID aKey, DBID bKey, DBID cKey)
private PriorityQueue<FCPair<Double,DBID>> calcDistsandNN(Relation<V> data, KernelMatrix kernelMatrix, int sampleSize, DBID aKey, HashMap<DBID,Double> dists)
private PriorityQueue<FCPair<Double,DBID>> calcDistsandRNDSample(Relation<V> data, KernelMatrix kernelMatrix, int sampleSize, DBID aKey, HashMap<DBID,Double> dists)
public void getExplanations(Relation<V> data)
data
- to get explanations forprivate void generateExplanation(Relation<V> data, DBID key, LinkedList<DBID> expList)
public OutlierResult run(Database database, Relation<V> relation)
database
- relation
- public TypeInformation[] getInputTypeRestriction()
AbstractAlgorithm
getInputTypeRestriction
in interface Algorithm
getInputTypeRestriction
in class AbstractAlgorithm<OutlierResult>
protected Logging getLogger()
AbstractAlgorithm
getLogger
in class AbstractAlgorithm<OutlierResult>