de.lmu.ifi.dbs.elki.algorithm.statistics
Class EvaluateRankingQuality<V extends RealVector<V,?>,D extends NumberDistance<D,?>>
java.lang.Object
de.lmu.ifi.dbs.elki.logging.AbstractLoggable
de.lmu.ifi.dbs.elki.utilities.optionhandling.AbstractParameterizable
de.lmu.ifi.dbs.elki.algorithm.AbstractAlgorithm<O,R>
de.lmu.ifi.dbs.elki.algorithm.DistanceBasedAlgorithm<V,D,CollectionResult<DoubleVector>>
de.lmu.ifi.dbs.elki.algorithm.statistics.EvaluateRankingQuality<V,D>
- Type Parameters:
V
- Vector type
- All Implemented Interfaces:
- Algorithm<V,CollectionResult<DoubleVector>>, Parameterizable
public class EvaluateRankingQuality<V extends RealVector<V,?>,D extends NumberDistance<D,?>>
- extends DistanceBasedAlgorithm<V,D,CollectionResult<DoubleVector>>
Evaluate a distance function with respect to kNN queries. For each point, the
neighbors are sorted by distance, then the ROC AUC is computed. A score of 1
means that the distance function provides a perfect ordering of relevant
neighbors first, then irrelevant neighbors. A value of 0.5 can be obtained by
random sorting. A value of 0 means the distance function is inverted, i.e. a
similarity.
TODO: Allow fixed binning range, configurable
TODO: Add sampling
- Author:
- Erich Schubert
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
result
private CollectionResult<DoubleVector> result
HISTOGRAM_BINS_ID
public static final OptionID HISTOGRAM_BINS_ID
- OptionID for
HISTOGRAM_BINS_OPTION
HISTOGRAM_BINS_OPTION
private final IntParameter HISTOGRAM_BINS_OPTION
- Option to configure the number of bins to use.
numbins
int numbins
- Number of bins to use.
EvaluateRankingQuality
public EvaluateRankingQuality()
- Empty constructor. Nothing to do.
runInTime
protected CollectionResult<DoubleVector> runInTime(Database<V> database)
throws IllegalStateException
- Run the algorithm.
- Specified by:
runInTime
in class AbstractAlgorithm<V extends RealVector<V,?>,CollectionResult<DoubleVector>>
- 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).
getDescription
public Description getDescription()
- Describe the algorithm and it's use.
- Returns:
- a description of the algorithm
getResult
public CollectionResult<DoubleVector> getResult()
- Return a result object
- Returns:
- the result of the algorithm
setParameters
public List<String> setParameters(List<String> args)
throws ParameterException
- Description copied from class:
DistanceBasedAlgorithm
- Calls the super method
and instantiates
DistanceBasedAlgorithm.distanceFunction
according to the value of parameter
DistanceBasedAlgorithm.DISTANCE_FUNCTION_PARAM
.
The remaining parameters are passed to the DistanceBasedAlgorithm.distanceFunction
.
- Specified by:
setParameters
in interface Parameterizable
- Overrides:
setParameters
in class DistanceBasedAlgorithm<V extends RealVector<V,?>,D extends NumberDistance<D,?>,CollectionResult<DoubleVector>>
- Parameters:
args
- parameters to set the attributes accordingly to
- Returns:
- a list containing the unused parameters
- Throws:
ParameterException
- in case of wrong parameter-setting