Environment for
DeveLoping
KDD-Applications
Supported by Index-Structures

de.lmu.ifi.dbs.elki.evaluation.roc
Class ComputeROCCurve<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.roc.ComputeROCCurve<O>
Type Parameters:
O - Database object type
All Implemented Interfaces:
Algorithm<O,MultiResult>, Parameterizable

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

Compute a ROC curve to evaluate a ranking algorithm and compute the corresponding ROCAUC value. The parameter -rocauc.positive specifies the class label of "positive" hits. The nested algorithm -algorithm will be run, the result will be searched for an iterable or ordering result, which then is compared with the clustering obtained via the given class label.

Author:
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  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 pattern to identify positive classes.
static AssociationID<Double> ROC_AUC
          The association id to associate the ROC Area-under-Curve.
 
Fields inherited from class de.lmu.ifi.dbs.elki.logging.AbstractLoggable
debug, logger
 
Constructor Summary
ComputeROCCurve(Parameterization config)
          Constructor
 
Method Summary
private  Iterator<Integer> getIterableResult(Database<O> database, Result result)
          Find an "iterable" result that looks like object IDs.
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


POSITIVE_CLASS_NAME_PARAM

private final PatternParameter POSITIVE_CLASS_NAME_PARAM
The pattern to identify positive classes.

Key: -rocauc.positive


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


positive_class_name

private Pattern positive_class_name
Stores the "positive" class.


algorithm

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


ROC_AUC

public static final AssociationID<Double> ROC_AUC
The association id to associate the ROC Area-under-Curve.

Constructor Detail

ComputeROCCurve

public ComputeROCCurve(Parameterization config)
Constructor

Parameters:
config - Parameters
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).

getIterableResult

private Iterator<Integer> getIterableResult(Database<O> database,
                                            Result result)
Find an "iterable" result that looks like object IDs.

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

Release 0.3 (2010-03-31_1612)