Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.evaluation.histogram
Class ComputeOutlierHistogram<O extends DatabaseObject>

java.lang.Object
  extended by de.lmu.ifi.dbs.elki.logging.AbstractLoggable
      extended by de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm<O,MultiResult>
          extended by de.lmu.ifi.dbs.elki.evaluation.histogram.ComputeOutlierHistogram<O>
Type Parameters:
O - Database object type
All Implemented Interfaces:
Algorithm<O,MultiResult>, Parameterizable

public class ComputeOutlierHistogram<O extends DatabaseObject>
extends AbstractAlgorithm<O,MultiResult>

Compute a Histogram to evaluate a ranking algorithm. The parameter -hist.positive specifies the class label of "positive" hits.

Author:
Lisa Reichert, Erich Schubert

Field Summary
private  Algorithm<O,Result> algorithm
          Holds the algorithm to run.
private  ObjectParameter<Algorithm<O,Result>> ALGORITHM_PARAM
          Parameter to specify the algorithm to be applied, must extend Algorithm.
private  int bins
          Number of bins
static OptionID BINS_ID
          OptionID for BINS_ID
private  IntParameter BINS_PARAM
          number of bins for the histogram Default value: EuclideanDistanceFunction Key: -comphist.bins
private  Pattern positive_class_name
          Stores the "positive" class.
static OptionID POSITIVE_CLASS_NAME_ID
          OptionID for POSITIVE_CLASS_NAME_PARAM
private  PatternParameter POSITIVE_CLASS_NAME_PARAM
          The object pattern to identify positive classes Key: -comphist.positive
private  ScalingFunction scaling
          Scaling function to use
static OptionID SCALING_ID
          OptionID for SCALING_PARAM
private  ObjectParameter<ScalingFunction> SCALING_PARAM
          Parameter to specify a scaling function to use.
private  boolean splitfreq
          Flag to make split frequencies
static OptionID SPLITFREQ_ID
          OptionID for SPLITFREQ_PARAM
private  Flag SPLITFREQ_PARAM
          Flag to count frequencies of outliers and non-outliers separately Key: -histogram.splitfreq
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
ComputeOutlierHistogram(Parameterization config)
          Constructor, adhering to Parameterizable
 
Method Summary
private  OutlierResult getOutlierResult(Database<O> database, Result result)
          Find an OutlierResult to work with.
protected  MultiResult runInTime(Database<O> database)
          The run method encapsulated in measure of runtime.
 
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.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
 

Field Detail

POSITIVE_CLASS_NAME_ID

public static final OptionID POSITIVE_CLASS_NAME_ID
OptionID for POSITIVE_CLASS_NAME_PARAM


BINS_ID

public static final OptionID BINS_ID
OptionID for BINS_ID


SCALING_ID

public static final OptionID SCALING_ID
OptionID for SCALING_PARAM


SPLITFREQ_ID

public static final OptionID SPLITFREQ_ID
OptionID for SPLITFREQ_PARAM


POSITIVE_CLASS_NAME_PARAM

private final PatternParameter POSITIVE_CLASS_NAME_PARAM
The object pattern to identify positive classes

Key: -comphist.positive


BINS_PARAM

private final IntParameter BINS_PARAM
number of bins for the histogram

Default value: EuclideanDistanceFunction

Key: -comphist.bins


ALGORITHM_PARAM

private final ObjectParameter<Algorithm<O extends DatabaseObject,Result>> ALGORITHM_PARAM
Parameter to specify the algorithm to be applied, must extend Algorithm.

Key: -algorithm


SCALING_PARAM

private final ObjectParameter<ScalingFunction> SCALING_PARAM
Parameter to specify a scaling function to use.

Key: -comphist.scaling


SPLITFREQ_PARAM

private final Flag SPLITFREQ_PARAM
Flag to count frequencies of outliers and non-outliers separately

Key: -histogram.splitfreq


positive_class_name

private Pattern positive_class_name
Stores the "positive" class.


bins

private int bins
Number of bins


algorithm

private Algorithm<O extends DatabaseObject,Result> algorithm
Holds the algorithm to run.


scaling

private ScalingFunction scaling
Scaling function to use


splitfreq

private boolean splitfreq
Flag to make split frequencies

Constructor Detail

ComputeOutlierHistogram

public ComputeOutlierHistogram(Parameterization config)
Constructor, adhering to Parameterizable

Parameters:
config - Parameterization
Method Detail

runInTime

protected MultiResult runInTime(Database<O> database)
                         throws IllegalStateException
Description copied from class: AbstractAlgorithm
The run method encapsulated in measure of runtime. An extending class needs not to take care of runtime itself.

Specified by:
runInTime in class AbstractAlgorithm<O extends DatabaseObject,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).

getOutlierResult

private OutlierResult getOutlierResult(Database<O> database,
                                       Result result)
Find an OutlierResult to work with.

Parameters:
database - Database context
result - Result object
Returns:
Iterator to work with

Release 0.3 (2010-03-31_1612)