Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.algorithm.outlier
Class SOD<V extends RealVector<V,Double>,D extends Distance<D>>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
          extended by de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm<V,MultiResult>
              extended by de.lmu.ifi.dbs.elki.algorithm.outlier.SOD<V,D>
Type Parameters:
V - the type of RealVector handled by this Algorithm
D - the type of Distance used by this Algorithm
All Implemented Interfaces:
Algorithm<V,MultiResult>, Parameterizable

public class SOD<V extends RealVector<V,Double>,D extends Distance<D>>
extends AbstractAlgorithm<V,MultiResult>

Author:
Arthur Zimek

Field Summary
private  double alpha
          Holds the value of ALPHA_PARAM.
static OptionID ALPHA_ID
          OptionID for ALPHA_PARAM
 DoubleParameter ALPHA_PARAM
          Parameter to indicate the multiplier for the discriminance value for discerning small from large variances.
private  int knn
          Holds the value of KNN_PARAM.
static OptionID KNN_ID
          OptionID for KNN_PARAM
private  IntParameter KNN_PARAM
          Parameter to specify the number of shared nearest neighbors to be considered for learning the subspace properties., must be an integer greater than 0.
private  SharedNearestNeighborSimilarityFunction<V,D> similarityFunction
          The similarity function.
static AssociationID<SODModel<?>> SOD_MODEL
          The association id to associate a subspace outlier degree.
private  MultiResult sodResult
          Holds the result.
 
Fields inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
optionHandler
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
SOD()
          Provides the SOD algorithm, adding parameters KNN_PARAM and ALPHA_PARAM to the option handler additionally to parameters of super class.
 
Method Summary
 Description getDescription()
          Returns a description of the algorithm.
private  KNNList<DoubleDistance> getKNN(Database<V> database, Integer queryObject)
          Provides the k nearest neighbors in terms of the shared nearest neighbor distance.
 MultiResult getResult()
          Returns the result of the algorithm.
protected  MultiResult runInTime(Database<V> database)
          Performs the SOD algorithm on the given database.
 List<String> setParameters(List<String> args)
          Calls the super method and sets additionally the values of the parameters KNN_PARAM and ALPHA_PARAM.
 
Methods inherited from class de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm
isTime, isVerbose, run, setTime, setVerbose
 
Methods inherited from class de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
addOption, addParameterizable, addParameterizable, checkGlobalParameterConstraints, collectOptions, getAttributeSettings, getParameters, rememberParametersExcept, removeOption, removeParameterizable, shortDescription
 
Methods inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debugFine, debugFiner, debugFinest, exception, progress, verbose, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.lmu.ifi.dbs.elki.utilities.optionhandling.Parameterizable
checkGlobalParameterConstraints, collectOptions, getParameters, shortDescription
 

Field Detail

SOD_MODEL

public static final AssociationID<SODModel<?>> SOD_MODEL
The association id to associate a subspace outlier degree.


KNN_ID

public static final OptionID KNN_ID
OptionID for KNN_PARAM


KNN_PARAM

private final IntParameter KNN_PARAM
Parameter to specify the number of shared nearest neighbors to be considered for learning the subspace properties., must be an integer greater than 0.

Default value: 1

Key: -sod.knn


knn

private int knn
Holds the value of KNN_PARAM.


ALPHA_ID

public static final OptionID ALPHA_ID
OptionID for ALPHA_PARAM


ALPHA_PARAM

public final DoubleParameter ALPHA_PARAM
Parameter to indicate the multiplier for the discriminance value for discerning small from large variances.

Default value: 1.1

Key: -sod.alpha


alpha

private double alpha
Holds the value of ALPHA_PARAM.


similarityFunction

private SharedNearestNeighborSimilarityFunction<V extends RealVector<V,Double>,D extends Distance<D>> similarityFunction
The similarity function.


sodResult

private MultiResult sodResult
Holds the result.

Constructor Detail

SOD

public SOD()
Provides the SOD algorithm, adding parameters KNN_PARAM and ALPHA_PARAM to the option handler additionally to parameters of super class.

Method Detail

runInTime

protected MultiResult runInTime(Database<V> database)
                         throws IllegalStateException
Performs the SOD algorithm on the given database.

Specified by:
runInTime in class AbstractAlgorithm<V extends RealVector<V,Double>,MultiResult>
Parameters:
database - the database to run the algorithm on
Returns:
the Result computed by this algorithm
Throws:
IllegalStateException - if the algorithm has not been initialized properly (e.g. the setParameters(String[]) method has been failed to be called).

getKNN

private KNNList<DoubleDistance> getKNN(Database<V> database,
                                       Integer queryObject)
Provides the k nearest neighbors in terms of the shared nearest neighbor distance.

The query object is excluded from the knn list.

Parameters:
database - the database holding the objects
queryObject - the query object for which the kNNs should be determined
Returns:
the k nearest neighbors in terms of the shared nearest neighbor distance without the query object

setParameters

public List<String> setParameters(List<String> args)
                           throws ParameterException
Calls the super method and sets additionally the values of the parameters KNN_PARAM and ALPHA_PARAM. The remaining parameters are passed to the similarityFunction.

Specified by:
setParameters in interface Parameterizable
Overrides:
setParameters in class AbstractAlgorithm<V extends RealVector<V,Double>,MultiResult>
Parameters:
args - parameters to set the attributes accordingly to
Returns:
a list containing the unused parameters
Throws:
ParameterException - in case of wrong parameter-setting

getDescription

public Description getDescription()
Description copied from interface: Algorithm
Returns a description of the algorithm.

Returns:
a description of the algorithm

getResult

public MultiResult getResult()
Description copied from interface: Algorithm
Returns the result of the algorithm.

Returns:
the result of the algorithm

Release 0.2 (2009-07-06_1820)